求vb代码-编一加密和解密程序,即将输入的一行字符串中的所有字母加密,加密后还可以再进行解密。
1个回答
展开全部
Option Explicit
'加密
Private Sub Command1_Click()
Text2 = ""
Dim i As Long
For i = 1 To Len(Text1)
Text2 = Text2 & Chr(Asc(Mid(Text1, i, 1)) - 300)
Next
Text1 = ""
End Sub
'解密
Private Sub Command2_Click()
Text1 = "纳燃肢"
Dim i As Long
For i = 1 To Len(Text2)
Text1 = Text1 & Chr(Asc(Mid(Text2, i, 1)) + 300)
Next
End Sub
'段卜原字符串
Private Sub Form_Load()
Text1 = "中华人洞世民共和国"
Text2 = ""
End Sub
'加密
Private Sub Command1_Click()
Text2 = ""
Dim i As Long
For i = 1 To Len(Text1)
Text2 = Text2 & Chr(Asc(Mid(Text1, i, 1)) - 300)
Next
Text1 = ""
End Sub
'解密
Private Sub Command2_Click()
Text1 = "纳燃肢"
Dim i As Long
For i = 1 To Len(Text2)
Text1 = Text1 & Chr(Asc(Mid(Text2, i, 1)) + 300)
Next
End Sub
'段卜原字符串
Private Sub Form_Load()
Text1 = "中华人洞世民共和国"
Text2 = ""
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询