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

C#

 
GeneralRe: C# windowless application for screen capture and replay Pin
Dan Neely18-Jun-09 9:17
Dan Neely18-Jun-09 9:17 
GeneralRe: C# windowless application for screen capture and replay Pin
parth_patel18-Jun-09 14:01
parth_patel18-Jun-09 14:01 
Questionc# crypto client/server problem Pin
Kraoc18-Jun-09 5:51
Kraoc18-Jun-09 5:51 
GeneralRe: c# crypto client/server problem Pin
harold aptroot18-Jun-09 6:40
harold aptroot18-Jun-09 6:40 
GeneralRe: c# crypto client/server problem Pin
Kraoc19-Jun-09 0:57
Kraoc19-Jun-09 0:57 
AnswerRe: c# crypto client/server problem Pin
OriginalGriff18-Jun-09 8:21
mveOriginalGriff18-Jun-09 8:21 
GeneralRe: c# crypto client/server problem [modified] Pin
Kraoc19-Jun-09 1:00
Kraoc19-Jun-09 1:00 
AnswerRe: c# crypto client/server problem [modified] Pin
Kraoc19-Jun-09 2:20
Kraoc19-Jun-09 2:20 
It seems that there's a known bug with the .Net framework when trying to serialize in a CryptoStream attached to a NetworkStream.

A bug has been discovered in the .NET library.
It is not possible to serialize to a CryptoStream that is attached to a NetworkStream because the Deserialize call on the receiving end of the stream will block until the stream is closed by the sending end.
You might note that all the MSDN examples use a backing MemoryStream, so perhaps this behavior is expected, but not documented.

A simple rule to avoid this problem is: never attach a CryptoStream to a NetworkStream. We sketch a possible implementation strategy:

* Use a CryptoStream attached to a MemoryStream.
You can serialize objects to this structure, then safely close the stream.
Then, get the byte array from the MemoryStream and write (or serialize, if part of a larger object) it to the NetworkStream. On the receiving side, reverse this process: recover the byte array, decrypt the bytes, then deserialize the result. 


A working exemple is given here using this method:
http://www.marcclifton.com/Default.aspx?tabid=138[^]

Nous ne sommes que des grains de sable mais nous sommes ensemble. Nous sommes comme les grains de sable sur la plage, mais sans les grains de sable la plage n’existerait pas.
Poème en langue yamato(japonais ancien)

modified on Sunday, June 21, 2009 4:06 PM

GeneralRe: c# crypto client/server problem Pin
OriginalGriff19-Jun-09 3:47
mveOriginalGriff19-Jun-09 3:47 
GeneralRe: c# crypto client/server problem Pin
Kraoc21-Jun-09 10:08
Kraoc21-Jun-09 10:08 
GeneralRe: c# crypto client/server problem Pin
OriginalGriff22-Jun-09 6:14
mveOriginalGriff22-Jun-09 6:14 
QuestionHow to Determine the path of .msi file? Pin
Narendra Reddy Vajrala18-Jun-09 5:26
Narendra Reddy Vajrala18-Jun-09 5:26 
AnswerRe: How to Determine the path of .msi file? Pin
MumbleB18-Jun-09 19:50
MumbleB18-Jun-09 19:50 
QuestionCheck to se if user is logged on Pin
precious roy18-Jun-09 4:47
precious roy18-Jun-09 4:47 
AnswerRe: Check to se if user is logged on Pin
dan!sh 18-Jun-09 5:01
professional dan!sh 18-Jun-09 5:01 
GeneralRe: Check to se if user is logged on Pin
precious roy18-Jun-09 5:17
precious roy18-Jun-09 5:17 
GeneralRe: Check to se if user is logged on Pin
dan!sh 18-Jun-09 5:54
professional dan!sh 18-Jun-09 5:54 
QuestionProblem between e.Graphics.DrawString() and PrintDirect Pin
totoprog18-Jun-09 4:25
totoprog18-Jun-09 4:25 
QuestionARCGIS, Please help!! It's urgent Pin
Andisheh_K18-Jun-09 4:11
Andisheh_K18-Jun-09 4:11 
AnswerRe: ARCGIS, Please help!! It's urgent Pin
DaveyM6918-Jun-09 4:17
professionalDaveyM6918-Jun-09 4:17 
GeneralRe: ARCGIS, Please help!! It's urgent Pin
Andisheh_K18-Jun-09 4:40
Andisheh_K18-Jun-09 4:40 
QuestionHow to develop sliding/moving icons/images using key in windows mobile Pin
shanky118-Jun-09 4:10
shanky118-Jun-09 4:10 
AnswerRe: How to develop sliding/moving icons/images using key in windows mobile Pin
Henry Minute18-Jun-09 8:33
Henry Minute18-Jun-09 8:33 
Questionobject instance shared across entire application Pin
jackgeek18-Jun-09 3:54
jackgeek18-Jun-09 3:54 
AnswerRe: object instance shared across entire application Pin
dan!sh 18-Jun-09 3:58
professional dan!sh 18-Jun-09 3:58 

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.