當前位置:編程學習大全網 - 編程軟體 - VB.net實現簡單的加密解密--->該怎麽寫代碼

VB.net實現簡單的加密解密--->該怎麽寫代碼

已在VB上調試通過:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim i, j As Integer

Dim et(TextBox1.Text.Length) As Char

j = 0

For i = 0 To TextBox1.Text.Length - 1

et(i) = Chr(AscW(TextBox1.Text.Chars(i)) + AscW(TextBox2.Text.Chars(j)))

j = j + 1

If j >= TextBox2.Text.Length Then j = 0

Next

TextBox1.Text = et

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Dim i, j As Integer

Dim et(TextBox1.Text.Length) As Char

j = 0

For i = 0 To TextBox1.Text.Length - 1

et(i) = Chr(AscW(TextBox1.Text.Chars(i)) - AscW(TextBox2.Text.Chars(j)))

j = j + 1

If j >= TextBox2.Text.Length Then j = 0

Next

TextBox1.Text = et

End Sub

  • 上一篇:求高手幫忙翻譯。很長。萬分感謝。
  • 下一篇:螺紋銑刀主要加工什麽工件的螺紋?
  • copyright 2024編程學習大全網