How to encrypt and decrypt text. This is a very simple method of encryption and you may want to use a different one for bigger projects. You change the values for your own encryption types and keys. Hope you guys like my first tutorial. Constructive criticism is always nice, as well on errors in my code.
GUI:
2 Text Boxes
2 Command Buttons
That's it.
Code for Declarations:
Code:
dim a as string
dim b as string
dim c as string
Code for Command1 :
Code:
Private Sub Command1_Click()
a = "a"
b = "b"
c = "c"
Text2.Text = Text1.Text
Text2.Text = Replace(Text2, a, "1")
Text2.Text = Replace(Text2, b, "2")
Text2.Text = Replace(Text2, c, "3")
End Sub
Code for Command2 :
Code:
Private Sub Command1_Click()
a = "1"
b = "2"
c = "3"
Text2.Text = Text1.Text
Text2.Text = Replace(Text2, a, "a")
Text2.Text = Replace(Text2, b, "b")
Text2.Text = Replace(Text2, c, "c")
End Sub
Notice the difference from Command1 and Command2. In Command1 a = "a" and text2.text = Replace(text2, a, "1"). In Command2 it's a = "1" and text2.text = Replace(text2, a, "a").
Last edited by ellipsis95; Jun 25th, 2008 at 04:17 PM.