Click here to Skip to main content
16,004,901 members
Home / Discussions / C#
   

C#

 
QuestionHow to write array of strings on a binary file Pin
Bahaa Hany28-Oct-06 1:15
Bahaa Hany28-Oct-06 1:15 
QuestionRe: How to write array of strings on a binary file Pin
Guffa28-Oct-06 1:43
Guffa28-Oct-06 1:43 
AnswerRe: How to write array of strings on a binary file Pin
Nader Elshehabi28-Oct-06 1:46
Nader Elshehabi28-Oct-06 1:46 
GeneralRe: How to write array of strings on a binary file Pin
S. Senthil Kumar28-Oct-06 3:36
S. Senthil Kumar28-Oct-06 3:36 
GeneralRe: How to write array of strings on a binary file Pin
Nader Elshehabi28-Oct-06 3:49
Nader Elshehabi28-Oct-06 3:49 
AnswerRe: How to write array of strings on a binary file Pin
Guffa28-Oct-06 4:29
Guffa28-Oct-06 4:29 
GeneralRe: How to write array of strings on a binary file Pin
Nader Elshehabi28-Oct-06 4:40
Nader Elshehabi28-Oct-06 4:40 
AnswerRe: How to write array of strings on a binary file Pin
Guffa28-Oct-06 5:10
Guffa28-Oct-06 5:10 
Yes, you are right in that. I didn't read the code thorougly enough, and was confused by the naming of the variables and what the code really should have been doing. He closes the stream when he should really close the writer instead.

The best way is of course to close the writer, not the stream:

writer.Close();


If you close the stream, you can solve the problem with the buffering in the writer by flushing the writer first, but it still leaves the writer in a confused and unusable state when the stream is closed.


---
b { font-weight: normal; }

QuestionGet Table Fields Description Pin
freshonlineMax28-Oct-06 0:55
freshonlineMax28-Oct-06 0:55 
AnswerRe: Get Table Fields Description Pin
Nader Elshehabi28-Oct-06 1:53
Nader Elshehabi28-Oct-06 1:53 
GeneralRe: Get Table Fields Description Pin
Robert Rohde28-Oct-06 3:33
Robert Rohde28-Oct-06 3:33 
GeneralRe: Get Table Fields Description Pin
Nader Elshehabi28-Oct-06 3:51
Nader Elshehabi28-Oct-06 3:51 
GeneralRe: Get Table Fields Description Pin
freshonlineMax28-Oct-06 8:03
freshonlineMax28-Oct-06 8:03 
GeneralRe: Get Table Fields Description [modified] Pin
Nader Elshehabi28-Oct-06 8:15
Nader Elshehabi28-Oct-06 8:15 
GeneralRe: Get Table Fields Description Pin
freshonlineMax28-Oct-06 19:44
freshonlineMax28-Oct-06 19:44 
AnswerRe: Get Table Fields Description Pin
Robert Rohde28-Oct-06 19:16
Robert Rohde28-Oct-06 19:16 
AnswerRe: Get Table Fields Description Pin
lainoo28-Oct-06 19:35
lainoo28-Oct-06 19:35 
QuestionCreating minidumps for windows forms in c#.net 2.0 Pin
pranu_1327-Oct-06 23:06
pranu_1327-Oct-06 23:06 
AnswerRe: Creating minidumps for windows forms in c#.net 2.0 Pin
Nader Elshehabi27-Oct-06 23:20
Nader Elshehabi27-Oct-06 23:20 
QuestionSession Problem. Pls Help Pin
subrata.jana27-Oct-06 21:44
subrata.jana27-Oct-06 21:44 
GeneralRe: Session Problem. Pls Help Pin
Guffa28-Oct-06 1:34
Guffa28-Oct-06 1:34 
QuestionHow to open a file in c# winform? Pin
ecscheng27-Oct-06 21:00
ecscheng27-Oct-06 21:00 
AnswerRe: How to open a file in c# winform? Pin
Stefan Troschuetz27-Oct-06 21:31
Stefan Troschuetz27-Oct-06 21:31 
QuestionBackgroundWorker Pin
freshonlineMax27-Oct-06 19:46
freshonlineMax27-Oct-06 19:46 
AnswerRe: BackgroundWorker Pin
Nader Elshehabi27-Oct-06 20:41
Nader Elshehabi27-Oct-06 20:41 

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.