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

C#

 
AnswerRe: How to recursively search directories Pin
led mike29-Sep-06 9:30
led mike29-Sep-06 9:30 
AnswerRe: How to recursively search directories Pin
mejojo29-Sep-06 11:26
mejojo29-Sep-06 11:26 
GeneralRe: How to recursively search directories Pin
iamnew2C#2-Oct-06 10:52
iamnew2C#2-Oct-06 10:52 
QuestionSelf Updating Application Pin
wasife29-Sep-06 9:05
wasife29-Sep-06 9:05 
QuestionRemove an attribute from a property at runtime Pin
Ista29-Sep-06 8:36
Ista29-Sep-06 8:36 
QuestionHelp with DES encryption & decryption Pin
Sreerag Gopinath29-Sep-06 8:16
Sreerag Gopinath29-Sep-06 8:16 
AnswerRe: Help with DES encryption & decryption Pin
geo_m29-Sep-06 21:54
geo_m29-Sep-06 21:54 
Questionquestion regarding BufferedStream Pin
Green Fuze29-Sep-06 8:10
Green Fuze29-Sep-06 8:10 
Hi everybody

I'm trying to send a large file accross a network.
the problem is that I'm losing many chunks.

At the beginning I tried to split the file myself and send it, but I had a lot of lost data, so I read about BufferedStream class that can take care of the chuncks by itself.

so, for sending the file I wrote:

stream = client.GetStream(); // to get the stream<br />
<br />
BufferedStream buff = new BufferedStream(stream);<br />
buff.Write(fileBytes, 0, fileBytes.Length); // writing the file<br />
<br />
buff.Flush();<br />
stream.Close();


for getting the file I wrote:

socket = listener.AcceptSocket();<br />
NetworkStream stream = new NetworkStream(socket);<br />
<br />
byte[] filebyte = new byte[filesize]; // creating array at the size of the file<br />
<br />
BufferedStream buff = new BufferedStream(stream);<br />
int readByte = 1;<br />
							<br />
while(readByte > 0) // when readByte is -1 it is the end of the stream<br />
	readByte = buff.Read(filebyte, 0, filebyte.Length);<br />
<br />
File.WriteAllBytes(filename, filebyte);<br />
<br />
buff.Flush();<br />
stream.Close();


The problem is that I still lose data, I really don't know what else to do.

ANY HELP will be highly appriciated!!! Smile | :)

Thanks!
QuestionIs it possible to store an encrypted files other than .txt in sql server using AES encryption(C#). Pin
TechnoDev29-Sep-06 7:15
TechnoDev29-Sep-06 7:15 
QuestionP2P messaging and file sharing over HTTP Pin
asamay29-Sep-06 6:44
asamay29-Sep-06 6:44 
Questionget Path from running instance of word ? Pin
sundar15629-Sep-06 6:38
sundar15629-Sep-06 6:38 
AnswerRe: get Path from running instance of word ? Pin
umseker29-Sep-06 7:58
umseker29-Sep-06 7:58 
GeneralRe: get Path from running instance of word ? Pin
sundar15629-Sep-06 10:42
sundar15629-Sep-06 10:42 
QuestionDrawing Connectors C# 2.0 Pin
robert11029-Sep-06 6:07
robert11029-Sep-06 6:07 
AnswerRe: Drawing Connectors C# 2.0 Pin
umseker29-Sep-06 8:36
umseker29-Sep-06 8:36 
QuestionIs it possible to store an encrypted txt file in sql server using AES encryption. Pin
TechnoDev29-Sep-06 4:52
TechnoDev29-Sep-06 4:52 
AnswerRe: Is it possible to store an encrypted txt file in sql server using AES encryption. Pin
led mike29-Sep-06 6:20
led mike29-Sep-06 6:20 
Questionoffice development Pin
fmardani29-Sep-06 4:30
fmardani29-Sep-06 4:30 
AnswerRe: office development Pin
Not Active29-Sep-06 5:32
mentorNot Active29-Sep-06 5:32 
QuestionCommand Line Argument access from another app Pin
UTRocketFan29-Sep-06 4:17
UTRocketFan29-Sep-06 4:17 
QuestionSystem.Web.Mail and CDO.Message Error Pin
Saamir29-Sep-06 3:48
Saamir29-Sep-06 3:48 
QuestionExecuting an executable unmanaged exe file... Pin
erikash29-Sep-06 3:21
erikash29-Sep-06 3:21 
AnswerRe: Executing an executable unmanaged exe file... Pin
Andrew Rissing29-Sep-06 5:03
Andrew Rissing29-Sep-06 5:03 
AnswerRe: Executing an executable unmanaged exe file... Pin
Judah Gabriel Himango29-Sep-06 5:12
sponsorJudah Gabriel Himango29-Sep-06 5:12 
QuestionRe: Executing an executable unmanaged exe file... Pin
erikash29-Sep-06 5:38
erikash29-Sep-06 5:38 

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.