Click here to Skip to main content
14,873,563 members
Home / Discussions / C#
   

C#

 
JokeRe: write file question Pin
darkelv7-Aug-08 19:30
Memberdarkelv7-Aug-08 19:30 
QuestionProblem with Byte Pin
softwarejaeger7-Aug-08 3:17
Membersoftwarejaeger7-Aug-08 3:17 
AnswerRe: Problem with Byte Pin
leppie7-Aug-08 3:32
Memberleppie7-Aug-08 3:32 
GeneralRe: Problem with Byte Pin
softwarejaeger7-Aug-08 3:36
Membersoftwarejaeger7-Aug-08 3:36 
GeneralRe: Problem with Byte Pin
leppie7-Aug-08 3:43
Memberleppie7-Aug-08 3:43 
GeneralRe: Problem with Byte Pin
#realJSOP7-Aug-08 4:19
mva#realJSOP7-Aug-08 4:19 
GeneralRe: Problem with Byte Pin
softwarejaeger7-Aug-08 3:58
Membersoftwarejaeger7-Aug-08 3:58 
AnswerRe: Problem with Byte Pin
#realJSOP7-Aug-08 4:16
mva#realJSOP7-Aug-08 4:16 
//do NOT allocate the array
byte[] Buffer = null;
// do this to avoid missing the "-1" during copy/paste while coding
int buffSize = clientConnection.ReceiveBufferSize-1;
// this will actually allocate the array for you and give you back the allocated size
int i = clientConnection.GetStream().Read(Buffer, 0, buffSize);
// now call the 1st overload of the GetString function
String result = System.Text.Encoding.ASCII.GetString(Buffer);
// and output your string
Console.WriteLine("INCOMING PACKAGE: " + result);


The byte array will never be larger than the amount of data returned, so you can convert it to a string in it's entirety without worrying about how big it is and how much actual data it contains.


"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


GeneralRe: Problem with Byte Pin
leppie7-Aug-08 5:15
Memberleppie7-Aug-08 5:15 
GeneralRe: Problem with Byte [modified] Pin
#realJSOP7-Aug-08 5:50
mva#realJSOP7-Aug-08 5:50 
GeneralRe: Problem with Byte [modified] Pin
Daniel Grunwald7-Aug-08 6:24
MemberDaniel Grunwald7-Aug-08 6:24 
AnswerRe: Problem with Byte Pin
Daniel Grunwald7-Aug-08 6:32
MemberDaniel Grunwald7-Aug-08 6:32 
QuestionExcel Pin
ellllllllie7-Aug-08 3:11
Memberellllllllie7-Aug-08 3:11 
AnswerRe: Excel Pin
Indivara7-Aug-08 4:56
professionalIndivara7-Aug-08 4:56 
QuestionC# Packet Question Pin
Spiro Floropoulos7-Aug-08 2:29
MemberSpiro Floropoulos7-Aug-08 2:29 
AnswerRe: C# Packet Question Pin
leppie7-Aug-08 2:51
Memberleppie7-Aug-08 2:51 
GeneralRe: C# Packet Question Pin
Spiro Floropoulos7-Aug-08 2:58
MemberSpiro Floropoulos7-Aug-08 2:58 
GeneralRe: C# Packet Question Pin
leppie7-Aug-08 3:02
Memberleppie7-Aug-08 3:02 
GeneralRe: C# Packet Question Pin
leppie7-Aug-08 3:03
Memberleppie7-Aug-08 3:03 
GeneralRe: C# Packet Question Pin
Spiro Floropoulos7-Aug-08 3:26
MemberSpiro Floropoulos7-Aug-08 3:26 
GeneralRe: C# Packet Question Pin
leppie7-Aug-08 3:29
Memberleppie7-Aug-08 3:29 
GeneralRe: C# Packet Question Pin
leppie7-Aug-08 4:19
Memberleppie7-Aug-08 4:19 
QuestionDelete Object from Memory? Pin
softwarejaeger7-Aug-08 2:26
Membersoftwarejaeger7-Aug-08 2:26 
AnswerRe: Delete Object from Memory? Pin
Simon P Stevens7-Aug-08 2:42
MemberSimon P Stevens7-Aug-08 2:42 
AnswerRe: Delete Object from Memory? Pin
#realJSOP7-Aug-08 2:44
mva#realJSOP7-Aug-08 2:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.