VB凯撒密码要求如图 急急急急急求
的有关信息介绍如下:Private Sub Command1_Click()
n = CInt(Text3)
s = Text1
For i = 1 To Len(s)
c = UCase(Mid(s, i, 1))
余亏 If c >= "A" And c <= "Z" Then
州颤 If Asc(c) > Asc("Z") - n Then
c = Chr(Asc(c) + n - 26)
Else
c = Chr(Asc(c) + n)
End If
Mid(s, i, 1) = c
End If
Next i
Text2 = s
End Sub
Private Sub Command2_Click()
n = CInt(Text3)
s = Text2
For i = 1 To Len(s)
c = UCase(Mid(s, i, 1))
If c >= "A" And c <= "Z" Then
If Asc(c) < Asc("A") + n Then
c = Chr(Asc(c) - n + 26)
Else
册毁败 c = Chr(Asc(c) - n)
End If
Mid(s, i, 1) = c
End If
Next i
Text1 = s
End Sub
Private Sub Form_Load()
Text1 = ""
Text2 = ""
Text3 = ""
End Sub