Click here to Skip to main content
15,918,889 members
Home / Discussions / C#
   

C#

 
GeneralRe: Advantages of standardizing development tools and environment Pin
Ennis Ray Lynch, Jr.9-Feb-09 10:01
Ennis Ray Lynch, Jr.9-Feb-09 10:01 
QuestionProblem with creating login application Pin
enigma1719849-Feb-09 8:08
enigma1719849-Feb-09 8:08 
AnswerRe: Problem with creating login application Pin
Wendelius9-Feb-09 8:14
mentorWendelius9-Feb-09 8:14 
AnswerRe: Problem with creating login application Pin
Pete O'Hanlon9-Feb-09 8:45
mvePete O'Hanlon9-Feb-09 8:45 
QuestionHelp with my project Pin
cdpace9-Feb-09 8:04
cdpace9-Feb-09 8:04 
AnswerRe: Help with my project Pin
akidan9-Feb-09 9:59
akidan9-Feb-09 9:59 
GeneralRe: Help with my project Pin
cdpace10-Feb-09 2:51
cdpace10-Feb-09 2:51 
GeneralRe: Help with my project Pin
akidan10-Feb-09 5:24
akidan10-Feb-09 5:24 
Ah, I think I might see the issue.
The Read function is a little funny on streams. It only guarantees that you will get some data back, but not how much. You are doing the right thing by checking the return value of Read and incrementing len - forgetting to do this is actually a common mistake you see in real-life programs.
When you are writing to your file, you need to only write how much data you read.
Say your read function reads in 500 bytes...
Notice the line
fsout.Write(buffer, 0, buffer.Length);

Even though you only read 500 bytes, you're writing out 1024 (buffer.Length)! You need to only write out to the file however much you read in. Fix that line, and I'll bet your program works without the need for doing thread sleeps.
GeneralRe: Help with my project Pin
cdpace11-Feb-09 10:17
cdpace11-Feb-09 10:17 
AnswerRe: Help with my project Pin
Ennis Ray Lynch, Jr.9-Feb-09 9:59
Ennis Ray Lynch, Jr.9-Feb-09 9:59 
QuestionDeploy apllication with password protected database Pin
chatravin9-Feb-09 6:59
chatravin9-Feb-09 6:59 
AnswerRe: Deploy apllication with password protected database Pin
EliottA9-Feb-09 7:28
EliottA9-Feb-09 7:28 
Questionhow to add Radio button list instead of checkboxes in listview Pin
netJP12L9-Feb-09 6:10
netJP12L9-Feb-09 6:10 
AnswerRe: how to add Radio button list instead of checkboxes in listview Pin
musefan9-Feb-09 6:39
musefan9-Feb-09 6:39 
AnswerRe: how to add Radio button list instead of checkboxes in listview Pin
howlettt9-Feb-09 8:31
howlettt9-Feb-09 8:31 
QuestionConnecting to database Pin
kibromg9-Feb-09 5:54
kibromg9-Feb-09 5:54 
AnswerRe: Connecting to database Pin
Rob Philpott9-Feb-09 6:03
Rob Philpott9-Feb-09 6:03 
GeneralRe: Connecting to database [modified] Pin
kibromg9-Feb-09 6:16
kibromg9-Feb-09 6:16 
GeneralRe: Connecting to database Pin
Rob Philpott9-Feb-09 6:27
Rob Philpott9-Feb-09 6:27 
GeneralRe: Connecting to database Pin
kibromg9-Feb-09 6:33
kibromg9-Feb-09 6:33 
GeneralRe: Connecting to database Pin
Rob Philpott9-Feb-09 6:43
Rob Philpott9-Feb-09 6:43 
GeneralRe: Connecting to database Pin
kibromg9-Feb-09 6:57
kibromg9-Feb-09 6:57 
GeneralRe: Connecting to database Pin
Rob Philpott9-Feb-09 8:54
Rob Philpott9-Feb-09 8:54 
GeneralRe: Connecting to database Pin
kibromg9-Feb-09 23:41
kibromg9-Feb-09 23:41 
GeneralRe: Connecting to database Pin
Rob Philpott9-Feb-09 23:50
Rob Philpott9-Feb-09 23:50 

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.