vb编程,设计一个文本加密程序。输入一个字符串,按照以下规律加密“

2024-11-23 10:58:41
推荐回答(1个)
回答1:

是不是弄错了,应该是wxyz转换为abcd吧?
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim ckey As Integer
If KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Then
ckey = KeyAscii + 4
If ckey > Asc("z") Then ckey = ckey - Asc("z") + Asc("a") - 1
KeyAscii = ckey
End If
If KeyAscii >= Asc("A") And KeyAscii <= Asc("Z") Then
ckey = KeyAscii + 4
If ckey > Asc("Z") Then ckey = ckey - Asc("Z") + Asc("A") - 1
KeyAscii = ckey
End If
End Sub