Click here to Skip to main content
15,909,051 members
Home / Discussions / C#
   

C#

 
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 
AnswerRe: Executing an executable unmanaged exe file... Pin
Judah Gabriel Himango29-Sep-06 6:08
sponsorJudah Gabriel Himango29-Sep-06 6:08 
AnswerRe: Executing an executable unmanaged exe file... Pin
Jim Conigliaro29-Sep-06 10:42
Jim Conigliaro29-Sep-06 10:42 
QuestionHOWTO Gather current user name from win service ? Pin
Alper Camel29-Sep-06 3:00
Alper Camel29-Sep-06 3:00 
AnswerRe: HOWTO Gather current user name from win service ? Pin
Colin Angus Mackay29-Sep-06 5:04
Colin Angus Mackay29-Sep-06 5:04 
Questioncan i put a row in an unbound mode in a bound datagridview ? Pin
bouha29-Sep-06 2:08
bouha29-Sep-06 2:08 
AnswerRe: can i put a row in an unbound mode in a bound datagridview ? Pin
LongRange.Shooter3-Oct-06 8:32
LongRange.Shooter3-Oct-06 8:32 

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.