Results 1 to 7 of 7

Thread: Encrypt function (vb-> C#) [Resolved]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member onerrorgoto's Avatar
    Join Date
    Aug 1999
    Location
    Sweden
    Posts
    330

    Encrypt function (vb-> C#) [Resolved]

    Hello
    Am trying to translate a vb-encrypt function to C# but I'm stuck.

    VB Code:
    1. Dim strChar, L, x
    2.      
    3.       L = Len(strKey)
    4.       For x = 1 To Len(strValue)
    5.          strChar = Asc(Mid$(strKey, (x Mod L) - L * ((x Mod L) = 0), 1))
    6.          Mid$(strValue, x, 1) = Chr$(Asc(Mid$(strValue, x, 1)) Xor strChar)
    7.       Next

    I have some trouble finding the correct functions for string manipulation.
    mid = .substring()
    chr$ = ? (is it (char) )
    ASC = ? (i think it is system.text.asciiencoding)
    mod = ? (cant find it in system.math)
    Xor = ? (cant find it in system.math)
    Last edited by onerrorgoto; Jul 8th, 2003 at 02:07 AM.
    Onerrorgoto

    Dont be to optimistic, the light at the end of the tunnel might be a train

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