Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
GeneralRe: Can a timer run within a thread in c# Pin
hellotkb18-Jun-07 22:19
hellotkb18-Jun-07 22:19 
Questionhow to access/read registry of a remote system Pin
devesh_code14-Jun-07 20:02
devesh_code14-Jun-07 20:02 
AnswerRe: how to access/read registry of a remote system Pin
Christian Graus14-Jun-07 21:09
protectorChristian Graus14-Jun-07 21:09 
GeneralRe: how to access/read registry of a remote system Pin
devesh_code14-Jun-07 21:20
devesh_code14-Jun-07 21:20 
AnswerRe: how to access/read registry of a remote system Pin
ScottM115-Jun-07 1:14
ScottM115-Jun-07 1:14 
GeneralRe: how to access/read registry of a remote system Pin
Dave Kreskowiak15-Jun-07 3:37
mveDave Kreskowiak15-Jun-07 3:37 
QuestionException while loading XslTransform Pin
Abhi Lahare14-Jun-07 19:58
Abhi Lahare14-Jun-07 19:58 
QuestionBinaryFormatter -> Invalid binaryHeader Pin
hansipet14-Jun-07 19:48
hansipet14-Jun-07 19:48 
Hello,
I have a strange problem. I want to send some objectes over Ethernet (UDP One packet is one object) After that I Deserialize the data, but I get allways an exception that there is an Invalid binaryheader. I don't have any idea how I can solve it.

my code is
<br />
int size = socket.Receive(buf);<br />
BinaryFormatter serializer = new BinaryFormatter();<br />
MemoryStream ms = new MemoryStream(buf,0,size);<br />
ms.Seek(0, SeekOrigin.Begin);<br />
LogMessage logMessage = (LogMessage)serializer.Deserialize(ms);<br />
Console::WriteLine("{0}", logMessage.ToString());<br />
ms.Close();<br />


and the sending function:
<br />
MemoryStream ms = new MemoryStream();<br />
BinaryFormatter serializer = new BinaryFormatter();<br />
<br />
serializer.Serialize(ms, logMessage);<br />
ms.Flush();<br />
ms.Seek(0, SeekOrigin.Begin);<br />
<br />
byte[] data = ms.ToArray();<br />
socket.Send(data);<br />
ms.Close();<br />


I have checked the MemoryStream and there is the whole data available (Sending and receiving)

LogMessage
Best regards
Hansjörg
AnswerRe: BinaryFormatter -> Invalid binaryHeader Pin
Soleil couchant14-Jun-07 22:55
Soleil couchant14-Jun-07 22:55 
GeneralRe: BinaryFormatter -> Invalid binaryHeader Pin
hansipet14-Jun-07 23:19
hansipet14-Jun-07 23:19 
GeneralRe: BinaryFormatter -> Invalid binaryHeader Pin
Rudolf Jan15-Jun-07 0:20
Rudolf Jan15-Jun-07 0:20 
GeneralRe: BinaryFormatter -> Invalid binaryHeader Pin
hansipet15-Jun-07 2:39
hansipet15-Jun-07 2:39 
GeneralRe: BinaryFormatter -> Invalid binaryHeader Pin
Rudolf Jan18-Jun-07 9:27
Rudolf Jan18-Jun-07 9:27 
GeneralRe: BinaryFormatter -> Invalid binaryHeader Pin
hansipet18-Jun-07 19:32
hansipet18-Jun-07 19:32 
GeneralRe: BinaryFormatter -> Invalid binaryHeader Pin
Rudolf Jan19-Jun-07 10:06
Rudolf Jan19-Jun-07 10:06 
GeneralRe: BinaryFormatter -> Invalid binaryHeader Pin
hansipet19-Jun-07 19:30
hansipet19-Jun-07 19:30 
AnswerRe: BinaryFormatter -> Invalid binaryHeader Pin
leppie15-Jun-07 0:32
leppie15-Jun-07 0:32 
GeneralRe: BinaryFormatter -> Invalid binaryHeader Pin
hansipet15-Jun-07 0:55
hansipet15-Jun-07 0:55 
QuestionHow to get a list of file from folder?? Pin
Life as a Coder14-Jun-07 19:29
Life as a Coder14-Jun-07 19:29 
AnswerRe: How to get a list of file from folder?? Pin
Martin#14-Jun-07 19:36
Martin#14-Jun-07 19:36 
GeneralProblem solved Pin
Life as a Coder14-Jun-07 22:54
Life as a Coder14-Jun-07 22:54 
GeneralRe: Problem solved Pin
Martin#14-Jun-07 22:55
Martin#14-Jun-07 22:55 
Questionwindows service with exchange server 2003 Pin
RahulRoy36914-Jun-07 19:05
RahulRoy36914-Jun-07 19:05 
Questionproblem with List and FindAll() Pin
dfn14-Jun-07 17:59
dfn14-Jun-07 17:59 
AnswerRe: problem with List and FindAll() Pin
Christian Graus14-Jun-07 18:11
protectorChristian Graus14-Jun-07 18:11 

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.