|
-
Sep 27th, 2002, 03:45 PM
#1
Thread Starter
Member
String to byte array
I wonder is there any way can easily convert a String to a byte array in VB.NET?
-
Sep 27th, 2002, 04:06 PM
#2
New Member
there is only two easy options:
1. convert your string to char-array
2. convert to base64 string
maybe someone found another easy solution,
good luck
Sascha
-
Sep 27th, 2002, 07:31 PM
#3
Hyperactive Member
Originally posted by Sascha
there is only two easy options:
1. convert your string to char-array
2. convert to base64 string
maybe someone found another easy solution,
good luck
Sascha
That doesn't describe much.
I think there's an Encoding class in the System.Text namespace. Look on your MSDN help to learn how to use it. The UTF8 encoding class should have the procedure your looking for.
Ahh, here's come code:
Code:
Dim strText As String = "This is a test."
Dim btArray() As Byte
btArray = System.Text.UTF8Encoding.ASCII.GetBytes(strText)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|