Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
GeneralRe: Bit Shifting problem Pin
norjali17-Aug-10 21:28
norjali17-Aug-10 21:28 
AnswerRe: Bit Shifting problem Pin
Richard MacCutchan17-Aug-10 21:26
mveRichard MacCutchan17-Aug-10 21:26 
GeneralRe: Bit Shifting problem Pin
norjali17-Aug-10 21:30
norjali17-Aug-10 21:30 
GeneralRe: Bit Shifting problem Pin
norjali17-Aug-10 21:53
norjali17-Aug-10 21:53 
GeneralRe: Bit Shifting problem Pin
Richard MacCutchan17-Aug-10 22:18
mveRichard MacCutchan17-Aug-10 22:18 
QuestionDataadapter and datasets issue Pin
maephisto00717-Aug-10 20:44
maephisto00717-Aug-10 20:44 
Questioncache the name using input param.. Pin
A.Machan Kachan17-Aug-10 17:56
A.Machan Kachan17-Aug-10 17:56 
QuestionHow to convert any object to byte[] without marking it Serializable or DataContract? Pin
1eyhk117-Aug-10 16:35
1eyhk117-Aug-10 16:35 
hello

How to convert any object to byte[] without marking it Serializable or DataContract?

Of course this would work but you'd need to mark myObj class Serializable (I'm lazy dont want handcode serializable for big classes sorry)

using (System.IO.MemoryStream returnStm = new System.IO.MemoryStream())
{
BinaryFormatter ftm = new BinaryFormatter();
ftm.Serialize(returnStm , myObj);
return returnStm .ToArray(); // this would return byte[]
}

Anyone who can tell me how I can commit such crime?

Thank you
AnswerRe: How to convert any object to byte[] without marking it Serializable or DataContract? Pin
Gonzalo Cao17-Aug-10 20:56
Gonzalo Cao17-Aug-10 20:56 
GeneralRe: How to convert any object to byte[] without marking it Serializable or DataContract? Pin
1eyhk118-Aug-10 1:51
1eyhk118-Aug-10 1:51 
GeneralReverse Pin
1eyhk118-Aug-10 16:19
1eyhk118-Aug-10 16:19 
GeneralRe: Reverse Pin
Gonzalo Cao18-Aug-10 20:18
Gonzalo Cao18-Aug-10 20:18 
GeneralRe: Reverse Pin
1eyhk118-Aug-10 21:43
1eyhk118-Aug-10 21:43 
GeneralRe: Reverse Pin
Gonzalo Cao18-Aug-10 21:44
Gonzalo Cao18-Aug-10 21:44 
GeneralWokring now, atttempts: from interop to BinaryFormatter to DataContractSerializer - still need to see MyAccount[] Pin
1eyhk120-Aug-10 19:33
1eyhk120-Aug-10 19:33 
GeneralRe: Wokring now, atttempts: from interop to BinaryFormatter to DataContractSerializer - still need to see MyAccount[] Pin
Gonzalo Cao23-Aug-10 21:50
Gonzalo Cao23-Aug-10 21:50 
GeneralRe: Wokring now, atttempts: from interop to BinaryFormatter to DataContractSerializer - still need to see MyAccount[] Pin
1eyhk123-Aug-10 21:58
1eyhk123-Aug-10 21:58 
Questionhow to combine audio file with video file Pin
yftah198917-Aug-10 9:56
yftah198917-Aug-10 9:56 
AnswerRe: how to combine audio file with video file Pin
Ravi Bhavnani17-Aug-10 10:38
professionalRavi Bhavnani17-Aug-10 10:38 
QuestionGPS Location Pin
Bravegee17-Aug-10 6:48
Bravegee17-Aug-10 6:48 
AnswerRe: GPS Location Pin
OriginalGriff17-Aug-10 8:16
mveOriginalGriff17-Aug-10 8:16 
GeneralRe: GPS Location Pin
Eduard Keilholz17-Aug-10 21:34
Eduard Keilholz17-Aug-10 21:34 
GeneralRe: GPS Location Pin
Bravegees18-Aug-10 0:03
Bravegees18-Aug-10 0:03 
GeneralRe: GPS Location Pin
Bravegees18-Aug-10 0:05
Bravegees18-Aug-10 0:05 
QuestionAnonymous delegates Pin
RugbyLeague17-Aug-10 4:41
RugbyLeague17-Aug-10 4:41 

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.