Results 1 to 13 of 13

Thread: Convert a string to binary, and back.

Threaded View

  1. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    VB Code:
    1. 'string to binary
    2. 'second argument converts the string from a base 10 number
    3. 'other valid arguments are 2, 8 & 16
    4. 'Method converts to a 32 bit Signed integer.
    5. Dim i as Int
    6. i = System.Convert.ToInt32 ("12345", 10)  
    7.  
    8. 'binary to string
    9. Dim s as String
    10. s = i.ToString()

    Other valid conversions

    ToInt16 - converts to a 16 bit signed integer
    ToInt64 - converts to a 64 bit signed integer

    ToUInt16 - converts to a 16 bit unsigned integer
    ToUInt32 - converts to a 32 bit unsigned integer
    ToUInt64 - converts to a 64 bit unsigned integer
    Last edited by Memnoch1207; May 22nd, 2003 at 11:57 AM.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

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