Skip to content

how could I do this !!! ?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #189048
    dNightMare
    Member

    Hey peeps,
    I need to know how to make some kind of an encryption in vb .I mean for example 2 text boxes with one commad button . when the user puts the text in the fist box his message is encrypted with a simple key . lets say when the user inputs “AAAA” the message in the second box shows “ZZZZ” for example I hope this idea is clear πŸ™‚ sorry I’m starting to play with vb so not much I know πŸ™ . I searched google many times but no luck I hope to find a solution in your great forum and please would you put an example πŸ˜†

    Regargs.

    #189052
    Admin
    Administrator

    I think you can do it like this

    Sub script()
    Text2.Text = Replace(Text1.Text, "a", "ΓƒΖ’Γ†β€™Γƒβ€šΓ‚Β’")
    Text2.Text = Replace(Text1.Text, "b", "ß")
    Text2.Text = Replace(Text1.Text, "c", "ΓƒΖ’Γ†β€™ΓƒΒ’Γ’β€šΒ¬Γ‚Β‘")
    Text2.Text = Replace(Text1.Text, "d", "ΓƒΖ’Γ†β€™Γƒβ€šΓ‚Β")
    Text2.Text = Replace(Text1.Text, "e", "ΓƒΖ’Γ†β€™Γƒβ€šΓ‚Β«")
    Text2.Text = Replace(Text1.Text, "f", "F")
    Text2.Text = Replace(Text1.Text, "g", "G")
    Text2.Text = Replace(Text1.Text, "h", "H")
    Text2.Text = Replace(Text1.Text, "i", "ΓƒΖ’Γ†β€™Γƒβ€šΓ‚Β­")
    Text2.Text = Replace(Text1.Text, "j", "J")
    Text2.Text = Replace(Text1.Text, "k", "K")
    Text2.Text = Replace(Text1.Text, "l", "ΓƒΖ’Γ’β‚¬Ε‘Γƒβ€šΓ‚Β£")
    Text2.Text = Replace(Text1.Text, "m", "M")
    Text2.Text = Replace(Text1.Text, "n", "ΓƒΖ’Γ†β€™ΓƒΒ’Γ’β€šΒ¬Γ‹Ε“")
    Text2.Text = Replace(Text1.Text, "o", "0")
    Text2.Text = Replace(Text1.Text, "p", "ΓƒΖ’Γ†β€™Γƒβ€šΓ‚ΒΎ")
    Text2.Text = Replace(Text1.Text, "q", "Q")
    Text2.Text = Replace(Text1.Text, "r", "R")
    Text2.Text = Replace(Text1.Text, "s", "ΓƒΖ’Γ’β‚¬Ε‘Γƒβ€šΓ‚Β§")
    Text2.Text = Replace(Text1.Text, "t", "T")
    Text2.Text = Replace(Text1.Text, "u", "ΓƒΖ’Γ†β€™Γƒβ€šΓ‚ΒΊ")
    Text2.Text = Replace(Text1.Text, "v", "V")
    Text2.Text = Replace(Text1.Text, "w", "W")
    Text2.Text = Replace(Text1.Text, "x", "ΓƒΖ’Γ†β€™ΓƒΒ’Γ’β€šΒ¬Γ’β‚¬Β")
    Text2.Text = Replace(Text1.Text, "y", "ΓƒΖ’Γ†β€™Γƒβ€šΓ‚Β")
    Text2.Text = Replace(Text1.Text, "z", "Z")
    End Sub

    then on a command button

    call script

    so what ever you type on text1 will be change on text two πŸ™‚ and u need to change to what u want to change the letter too for example Text2.Text = Replace(Text1.Text, “a”, “ΓƒΖ’Γ†β€™Γƒβ€šΓ‚Β’”) you can change it, lets say you want a to be z then u do it like this Text2.Text = Replace(Text1.Text, “a”, “z”) thats it, I think there othe ways but thats the way i done it πŸ˜€

    #189051
    dNightMare
    Member

    wow thank you so much Admin πŸ™‚ . I can’t wait I’ll try it .

    Thanks again πŸ™‚ tc .

    #189050
    dNightMare
    Member

    Hi Admin .
    I tried your code but it only processes the last line : i.e:

    Text2.Text = Replace(Text1.Text, "y", "ΓƒΖ’Γ†β€™Γƒβ€šΓ‚Β")
    Text2.Text = Replace(Text1.Text, "z", "Z")

    the remaining lines just pasted the same char for example y printed as y not “ΓƒΖ’Γ†β€™Γƒβ€šΓ‚Β” :/
    please I need help I want it to process all the chars any ideas whats wrong !!!

    Thanks in advance.

    #189049
    Admin
    Administrator

    umm thas weird are u using capitals letters, another thing send me ur code private if u want me to take a look at it 8)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.