Click here to Skip to main content
15,905,508 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to avoid reading first three lines in a text file? Pin
RugbyLeague15-Jun-07 1:28
RugbyLeague15-Jun-07 1:28 
GeneralRe: How to avoid reading first three lines in a text file? Pin
khuzwayom15-Jun-07 3:37
khuzwayom15-Jun-07 3:37 
QuestionCan a timer run within a thread in c# Pin
hellotkb14-Jun-07 21:14
hellotkb14-Jun-07 21:14 
AnswerRe: Can a timer run within a thread in c# Pin
MidwestLimey15-Jun-07 5:23
professionalMidwestLimey15-Jun-07 5:23 
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 

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.