VB:编写一个加密程序,加密思想将每个字母向后顺序移动5个字符,如A→F a→f 非字母字符原样输出求大神
1个回答
展开全部
变量定义比较随意,请根据实际修改。 text1是原来的数据,text2是转换后的数据 Private Sub Command1_Click() On Error Resume Next Dim a As String Dim b As Integer Dim c As String Dim i As Integer a = Text1.Text b = Len(Text1.Text) For i = 0 To b If Asc(Left(a, 1)) >= 65 And Asc(Left(a, 1)) <= 90 Or Asc(Left(a, 1)) >= 97 And Asc(Left(a, 1)) <= 122 Then c = c & Chr(Asc(Left(a, 1)) + 5) Else c = c & Left(a, 1) End If a = Right(a, Len(a) - 1) Next Text2.Text = c End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询