Click here to Skip to main content
15,908,172 members
Home / Discussions / C#
   

C#

 
GeneralRe: perform search in google from c# application Pin
Dave Kreskowiak31-Jul-09 13:19
mveDave Kreskowiak31-Jul-09 13:19 
GeneralRe: perform search in google from c# application Pin
nelsonpaixao31-Jul-09 16:30
nelsonpaixao31-Jul-09 16:30 
GeneralRe: perform search in google from c# application Pin
Dave Kreskowiak31-Jul-09 18:40
mveDave Kreskowiak31-Jul-09 18:40 
GeneralRe: perform search in google from c# application Pin
nelsonpaixao1-Aug-09 5:42
nelsonpaixao1-Aug-09 5:42 
QuestionUsing StreamReader to read an unkown amount of lines / data. Pin
noiser30-Jul-09 15:49
noiser30-Jul-09 15:49 
AnswerRe: Using StreamReader to read an unkown amount of lines / data. Pin
Super Lloyd30-Jul-09 18:27
Super Lloyd30-Jul-09 18:27 
GeneralRe: Using StreamReader to read an unkown amount of lines / data. Pin
noiser31-Jul-09 1:55
noiser31-Jul-09 1:55 
GeneralRe: Using StreamReader to read an unkown amount of lines / data. Pin
Super Lloyd31-Jul-09 2:05
Super Lloyd31-Jul-09 2:05 
how about:
string line;
while((line = streamRead.ReadLine()) != null)
{
// do something
}

or
string text = streamReader.ReadToEnd()


However all those method have problem when reading from a socket where the flow of data is potentially unpredictable (although, I believe, a TCP packet is at least 255 user bytes long and guaranteed to arrive in one burst)
So it's why over the wire communication protocol makes heavy use of header fields!

I would be you, the simplest thing I would do is

// server
var br = new BinaryWriter(outsream);
br.Write(numString);
for(int i=0; i<numstring; i++)="" br.write(strings[i]);

on="" the="" server="" side
var="" br="new" binaryreader(instream);
int="" n="br.ReadInt32();
for(int" i="0;" i<n;="" list.add(br.readstring());


and="" that's="" simplest="" one!
i="" might="" do="" some="" more="" sophisticated="" header...

and="" better="" exception="" handing="" of="" course!="" Wink | ;-) =""

<div="" class="ForumSig">A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
GeneralRe: Using StreamReader to read an unkown amount of lines / data. Pin
noiser1-Aug-09 8:34
noiser1-Aug-09 8:34 
GeneralRe: Using StreamReader to read an unkown amount of lines / data. Pin
Super Lloyd1-Aug-09 16:52
Super Lloyd1-Aug-09 16:52 
GeneralRe: Using StreamReader to read an unkown amount of lines / data. Pin
noiser1-Aug-09 17:38
noiser1-Aug-09 17:38 
QuestionDownloading unknown number of files from web server Pin
steve_rm30-Jul-09 14:26
steve_rm30-Jul-09 14:26 
AnswerRe: Downloading unknown number of files from web server Pin
Christian Graus30-Jul-09 14:44
protectorChristian Graus30-Jul-09 14:44 
QuestionList<string> Help</string> Pin
Gregory Bryant30-Jul-09 13:13
Gregory Bryant30-Jul-09 13:13 
AnswerRe: List Help Pin
Christian Graus30-Jul-09 13:55
protectorChristian Graus30-Jul-09 13:55 
QuestionUpdating data in data set and data table. Pin
Omar Akhtar Sheikh30-Jul-09 11:29
Omar Akhtar Sheikh30-Jul-09 11:29 
AnswerRe: Updating data in data set and data table. Pin
nelsonpaixao30-Jul-09 14:11
nelsonpaixao30-Jul-09 14:11 
QuestionWeb Services Issue Pin
caksabre230-Jul-09 10:24
caksabre230-Jul-09 10:24 
AnswerRe: Web Services Issue Pin
Robin_Roy30-Jul-09 17:04
Robin_Roy30-Jul-09 17:04 
Questionimporting system.deployment Pin
Vivek Vijayan30-Jul-09 9:17
Vivek Vijayan30-Jul-09 9:17 
AnswerRe: importing system.deployment Pin
Dave Kreskowiak30-Jul-09 9:35
mveDave Kreskowiak30-Jul-09 9:35 
AnswerRe: importing system.deployment Pin
Abhishek Sur30-Jul-09 10:15
professionalAbhishek Sur30-Jul-09 10:15 
GeneralRe: importing system.deployment Pin
Vivek Vijayan30-Jul-09 22:20
Vivek Vijayan30-Jul-09 22:20 
GeneralRe: importing system.deployment Pin
Abhishek Sur30-Jul-09 23:09
professionalAbhishek Sur30-Jul-09 23:09 
QuestionScreenshot after WebBrowser Navigates Pin
VengefulSakhmet30-Jul-09 8:30
VengefulSakhmet30-Jul-09 8:30 

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.