|
-
Aug 25th, 2005, 04:15 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] convert string to array
hi,
string test1; byte[] test2;
It is posible to convert or parse string to byte array in C#?
thanks...
Popskie
-
Aug 25th, 2005, 04:38 AM
#2
Hyperactive Member
Re: convert string to array
I think you need to use the encoding classes: like this:
Code:
string test = "Hello World";
byte [] myByte = Encoding.UTF8.GetBytes(test);
HTH, Stephan
Keep Smiling - even if its hard 
Frankie Says Relax, wossname Says Yeah!
wossname:--Currently I'm wearing a gimp suit and a parachute.
C# - Base64 Blog
-
Aug 25th, 2005, 01:28 PM
#3
Re: convert string to array
hmm I would do Ascii.getbytes
why utf8? I dont even know what it is
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Aug 25th, 2005, 08:59 PM
#4
Thread Starter
Fanatic Member
Re: convert string to array
MrPolite is correct there is no utf8 but my problem didnt get here. Ok i explain what i need here. First i hve a fieldtype image. When i retrieve that table my image field is save to listview subitem as string. when the user click that subitem i want to convert that string to byte[] in order to view that image but i got an error here . The error is invalid parameter used or invalid cast. What the problem. I already convert into byte[] but the error stil der.
Last edited by popskie; Aug 25th, 2005 at 09:13 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|