i am only new in vb 10 and i am creating a vigenere cipher program but i dont know how to call a function in a button. here's my code:
Public Shared Function Encrypt(ByVal cipherTxt As String, ByVal key As String)
Dim encryptedText As String = ""
For i As Integer = 1 To cipherTxt.Length
Dim temp As Integer = AscW(GetChar(cipherTxt, i)) + AscW(GetChar(key, i Mod key.Length + 1))
encryptedText += ChrW(temp)
Next
Return encryptedText
End Function
Public Shared Function Decrypt(ByVal cipherTxt As String, ByVal key As String)
Dim decryptedText As String = ""
For i As Integer = 1 To cipherTxt.Length
Dim temp As Integer = AscW(GetChar(cipherTxt, i)) - AscW(GetChar(key, i Mod key.Length + 1))
decryptedText += ChrW(temp)
Next
Return decryptedText
End Function
Any help? Thank you.