简单VB.NET加密与解密

2024-12-27 17:59:52
推荐回答(1个)
回答1:

Private Function myEncrypt(ByVal Code As String) As String
Dim Result As String = ""

Dim CurrentChar As Char

For i As Integer = 0 To Code.Length - 1

CurrentChar = Code.Substring(i, 1)

Select Case Code.Substring(i, 1)
Case "Z"
Result &= "a"
Case "z"
Result &= "A"
Case Else
Result &= Chr(Asc(CurrentChar) + 1)
End Select
Next
Return Result
End Function

'vb.net 2005 调试通过