|
-
Mar 31st, 2004, 04:41 PM
#1
Thread Starter
Frenzied Member
ToString Help[resolved]
Code:
byte b;
string s ="";
for(int i = 0; i < Stream.Length; i++)
{
b = (byte)Stream.ReadByte();
s += b.ToString("g");
}
I want ascci text to come out but all I get are numbers. Can anyone tell me about why and what to do. the Stream is from a text file that contains ascii text. I'm confused because I swear when I was using System.Console and reading it I used ToString("g").....
Last edited by Magiaus; Apr 1st, 2004 at 08:08 AM.
Magiaus
If I helped give me some points.
-
Mar 31st, 2004, 05:08 PM
#2
Thread Starter
Frenzied Member
Code:
byte b;
string s ="";
for(int i = 0; i < Stream.Length; i++)
{
s += (char)Stream.ReadByte();
}
I'm knew I shouldn't have had that 12 pack with lunch.....
Last edited by Magiaus; Apr 1st, 2004 at 08:07 AM.
Magiaus
If I helped give me some points.
-
Apr 1st, 2004, 02:50 AM
#3
btw how come the second line doesnt end with a semi-colon and then the line inside the forloop has two semi-colons?
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!!
-
Apr 1st, 2004, 08:06 AM
#4
Thread Starter
Frenzied Member
because I just typed it in. The first post should also have a (byte) cast on ReadByte because it returns an int.
Magiaus
If I helped give me some points.
-
Apr 1st, 2004, 08:08 AM
#5
Thread Starter
Frenzied Member
Magiaus
If I helped give me some points.
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
|