Click here to Skip to main content
15,888,239 members
Home / Discussions / C#
   

C#

 
AnswerRe: Basic Insert Row Question Pin
BobJanova13-Jun-11 3:25
BobJanova13-Jun-11 3:25 
AnswerRe: Basic Insert Row Question Pin
AmbiguousName13-Jun-11 18:34
AmbiguousName13-Jun-11 18:34 
Questionhow to monitor downloaded and uploaded data Pin
Aisha sharma12-Jun-11 22:17
Aisha sharma12-Jun-11 22:17 
QuestionHow to create xml file in disk location using SQL Server 2005 & C#...? Pin
Manish_Kumar_Nayak12-Jun-11 21:03
Manish_Kumar_Nayak12-Jun-11 21:03 
AnswerRe: How to create xml file in disk location using SQL Server 2005 & C#...? Pin
Richard MacCutchan12-Jun-11 23:46
mveRichard MacCutchan12-Jun-11 23:46 
AnswerRe: How to create xml file in disk location using SQL Server 2005 & C#...? Pin
jschell13-Jun-11 8:43
jschell13-Jun-11 8:43 
QuestionGetting data from host, convert to string and then to bytes again. Pin
krosty478212-Jun-11 13:06
krosty478212-Jun-11 13:06 
AnswerRe: Getting data from host, convert to string and then to bytes again. Pin
Luc Pattyn12-Jun-11 13:42
sitebuilderLuc Pattyn12-Jun-11 13:42 
Hi,

your design is seriously flawed for a couple of reasons:

1. When transferring arbitrary files (not just text files), you should use a "binary mode", i.e. you should treat all the data as bytes, and never try and turn them into strings as that will lead to all kinds of problems.

2. In order to determine the length of the file, or the amount of data, at the receiver end, the preferred method is by simply transmitting the length. Looking for a specific data pattern (a bit pattern, a string, it doesn't matter) is unsafe, as the same pattern could exist inside the actual data, resulting in a premature end of transmission. So get an int or a long holding the length and transmit that first, from then on the receiver can count down until it has had enough.

So I suggest you revise your approach and your code completely.

FWIW: your code is losing all '|' characters!

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Please use <PRE> tags for code snippets, they improve readability.
CP Vanity has been updated to V2.4

modified on Sunday, June 12, 2011 8:19 PM

GeneralRe: Getting data from host, convert to string and then to bytes again. Pin
krosty478212-Jun-11 15:07
krosty478212-Jun-11 15:07 
AnswerRe: Getting data from host, convert to string and then to bytes again. Pin
Luc Pattyn12-Jun-11 15:21
sitebuilderLuc Pattyn12-Jun-11 15:21 
GeneralRe: Getting data from host, convert to string and then to bytes again. Pin
krosty478215-Jun-11 12:53
krosty478215-Jun-11 12:53 
AnswerRe: Getting data from host, convert to string and then to bytes again. Pin
Luc Pattyn12-Jun-11 15:34
sitebuilderLuc Pattyn12-Jun-11 15:34 
GeneralRe: Getting data from host, convert to string and then to bytes again. Pin
BobJanova13-Jun-11 0:05
BobJanova13-Jun-11 0:05 
QuestionUsing Cobol Copy Books Pin
MumbleB11-Jun-11 0:53
MumbleB11-Jun-11 0:53 
AnswerRe: Using Cobol Copy Books Pin
PIEBALDconsult11-Jun-11 3:33
mvePIEBALDconsult11-Jun-11 3:33 
AnswerRe: Using Cobol Copy Books Pin
Luc Pattyn11-Jun-11 3:53
sitebuilderLuc Pattyn11-Jun-11 3:53 
GeneralRe: Using Cobol Copy Books Pin
PIEBALDconsult11-Jun-11 6:09
mvePIEBALDconsult11-Jun-11 6:09 
AnswerRe: Using Cobol Copy Books Pin
Luc Pattyn11-Jun-11 6:27
sitebuilderLuc Pattyn11-Jun-11 6:27 
GeneralRe: Using Cobol Copy Books Pin
PIEBALDconsult11-Jun-11 14:03
mvePIEBALDconsult11-Jun-11 14:03 
AnswerRe: Using Cobol Copy Books Pin
Not Active11-Jun-11 5:29
mentorNot Active11-Jun-11 5:29 
GeneralRe: Using Cobol Copy Books Pin
MumbleB11-Jun-11 6:53
MumbleB11-Jun-11 6:53 
AnswerRe: Using Cobol Copy Books Pin
DaveyM6911-Jun-11 10:19
professionalDaveyM6911-Jun-11 10:19 
QuestionPrintPreviewControl and HTML Pin
dSolariuM10-Jun-11 23:36
dSolariuM10-Jun-11 23:36 
AnswerRe: PrintPreviewControl and HTML Pin
Luc Pattyn11-Jun-11 0:11
sitebuilderLuc Pattyn11-Jun-11 0:11 
GeneralRe: PrintPreviewControl and HTML Pin
MumbleB11-Jun-11 1:19
MumbleB11-Jun-11 1:19 

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.