Results 1 to 5 of 5

Thread: VB-6 Simple Method to Encrypt / Decrypt Text.

Threaded View

  1. #1

    Thread Starter
    New Member ellipsis95's Avatar
    Join Date
    Jun 2008
    Posts
    12

    VB-6 Simple Method to Encrypt / Decrypt Text.

    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").
    Attached Files Attached Files
    Last edited by ellipsis95; Jun 25th, 2008 at 04:17 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width