Click here to Skip to main content
15,894,740 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# and Reporting Service Pin
farhit30-Aug-07 9:44
farhit30-Aug-07 9:44 
GeneralRe: C# and Reporting Service Pin
pmarfleet30-Aug-07 10:06
pmarfleet30-Aug-07 10:06 
Question.NET Framework Class List Pin
student_rhr30-Aug-07 4:36
student_rhr30-Aug-07 4:36 
AnswerRe: .NET Framework Class List Pin
Judah Gabriel Himango30-Aug-07 5:02
sponsorJudah Gabriel Himango30-Aug-07 5:02 
QuestionWrting bytes to a file(xls) Pin
gauthee30-Aug-07 4:13
gauthee30-Aug-07 4:13 
AnswerRe: Wrting bytes to a file(xls) Pin
Justin Perez30-Aug-07 4:21
Justin Perez30-Aug-07 4:21 
GeneralRe: Wrting bytes to a file(xls) Pin
gauthee30-Aug-07 19:37
gauthee30-Aug-07 19:37 
AnswerRe: Wrting bytes to a file(xls) Pin
lmoelleb30-Aug-07 23:11
lmoelleb30-Aug-07 23:11 
If your XSL file is for example 400 bytes long, your read operation will read somewhere between 1 and 399 bytes (both extremes included).

It can never 400 as you tell it to read fs.Length - 1

It is not even certain it will read 399 bytes, as any stream can choose to chunk any way it likes. The only thing you know for sure is that it will return minimum 1 byte (as long end of file has not been reached) and maximum the number you specify.

Either loop the read (you get the number of bytes read in the return value), or use a BinaryReader which offer the possibility to read a fixed number of bytes without any chunking (it will simply do the looping for you).

QuestionMenuStrip Names Pin
topksharma198230-Aug-07 3:55
topksharma198230-Aug-07 3:55 
AnswerRe: MenuStrip Names Pin
Judah Gabriel Himango30-Aug-07 5:00
sponsorJudah Gabriel Himango30-Aug-07 5:00 
GeneralRe: MenuStrip Names Pin
topksharma198230-Aug-07 7:08
topksharma198230-Aug-07 7:08 
QuestionGeneral newbie type question Pin
shwaguy30-Aug-07 3:30
shwaguy30-Aug-07 3:30 
AnswerRe: General newbie type question Pin
Spacix One30-Aug-07 4:10
Spacix One30-Aug-07 4:10 
GeneralRe: General newbie type question Pin
martin_hughes30-Aug-07 4:25
martin_hughes30-Aug-07 4:25 
GeneralRe: General newbie type question Pin
Spacix One30-Aug-07 4:53
Spacix One30-Aug-07 4:53 
JokeRe: General newbie type question Pin
PIEBALDconsult30-Aug-07 5:44
mvePIEBALDconsult30-Aug-07 5:44 
AnswerRe: General newbie type question Pin
shwaguy30-Aug-07 9:11
shwaguy30-Aug-07 9:11 
QuestionStrange Problem at writing file Pin
error140830-Aug-07 3:29
error140830-Aug-07 3:29 
AnswerRe: Strange Problem at writing file Pin
Spacix One30-Aug-07 3:59
Spacix One30-Aug-07 3:59 
GeneralRe: Strange Problem at writing file Pin
error140830-Aug-07 4:13
error140830-Aug-07 4:13 
GeneralRe: Strange Problem at writing file Pin
Spacix One30-Aug-07 4:18
Spacix One30-Aug-07 4:18 
GeneralRe: Strange Problem at writing file Pin
error140830-Aug-07 4:19
error140830-Aug-07 4:19 
GeneralRe: Strange Problem at writing file Pin
Spacix One30-Aug-07 4:55
Spacix One30-Aug-07 4:55 
GeneralRe: Strange Problem at writing file Pin
error140830-Aug-07 5:05
error140830-Aug-07 5:05 
GeneralRe: Strange Problem at writing file Pin
J4amieC30-Aug-07 5:09
J4amieC30-Aug-07 5:09 

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.