Click here to Skip to main content
15,946,012 members
Home / Discussions / C#
   

C#

 
AnswerRe: run asp.net appn on iis Pin
Christian Graus30-Apr-08 23:09
protectorChristian Graus30-Apr-08 23:09 
QuestionHow to get all files name from Property.Resourece Pin
Guru Call30-Apr-08 20:32
Guru Call30-Apr-08 20:32 
AnswerRe: How to get all files name from Property.Resourece Pin
Gopal.S1-May-08 1:34
Gopal.S1-May-08 1:34 
QuestionDisplaying lines of code as a program runs Pin
MarkB77730-Apr-08 20:13
MarkB77730-Apr-08 20:13 
AnswerRe: Displaying lines of code as a program runs Pin
Christian Graus30-Apr-08 20:15
protectorChristian Graus30-Apr-08 20:15 
GeneralRe: Displaying lines of code as a program runs Pin
Roger Alsing30-Apr-08 21:48
Roger Alsing30-Apr-08 21:48 
QuestionFile Structure Serialization Pin
Ian Uy30-Apr-08 20:05
Ian Uy30-Apr-08 20:05 
AnswerRe: File Structure Serialization Pin
carbon_golem1-May-08 2:59
carbon_golem1-May-08 2:59 
I have a couple of questions.
1) What are you encrypting, and why a Hashtable?
2) Why did you choose a struct?
3) Have you checked the post-RawSerialize() byte arrays to verify sizes?
4) Are you using unmanaged code in your project?

And recommendations.
1) Go back on the Net and study up on the difference between ValueTypes and ReferenceTypes.
2) Use caution when you snag some code, you'll have to understand what's going on.

What I think is going on here is a boxing issue. You're using a struct to hold data, however your serialization routines are calling for Object. So, when you pass in your struct it is boxed, turning it into a reference type. Then you're calling Marshal.StructureToPtr passing in the boxed value. In essence you're serializing the address of your struct. That's why it's writing the 4 characters (8 bytes) to the file.

Scott P

"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand

GeneralRe: File Structure Serialization Pin
Ian Uy1-May-08 3:05
Ian Uy1-May-08 3:05 
GeneralRe: File Structure Serialization Pin
carbon_golem1-May-08 3:41
carbon_golem1-May-08 3:41 
GeneralRe: File Structure Serialization Pin
Ian Uy1-May-08 3:49
Ian Uy1-May-08 3:49 
GeneralRe: File Structure Serialization Pin
carbon_golem1-May-08 3:57
carbon_golem1-May-08 3:57 
QuestionPlease Help !Query executing in oracle but not executing through code Pin
ravindradonkada30-Apr-08 19:46
ravindradonkada30-Apr-08 19:46 
AnswerRe: Please Help !Query executing in oracle but not executing through code Pin
Christian Graus30-Apr-08 20:18
protectorChristian Graus30-Apr-08 20:18 
AnswerRe: Please Help !Query executing in oracle but not executing through code [modified] Pin
Mircea Puiu1-May-08 4:46
Mircea Puiu1-May-08 4:46 
QuestionDetect Shift when Menu Opens Pin
Chris_McGrath30-Apr-08 19:28
Chris_McGrath30-Apr-08 19:28 
AnswerRe: Detect Shift when Menu Opens Pin
Chris_McGrath30-Apr-08 19:45
Chris_McGrath30-Apr-08 19:45 
QuestionHOW TO CREATE AN INSTANCE OF INTERNET EXPLORER AND HOW TO USE IT? Pin
syamooo30-Apr-08 18:55
syamooo30-Apr-08 18:55 
AnswerRe: HOW TO CREATE AN INSTANCE OF INTERNET EXPLORER AND HOW TO USE IT? Pin
Christian Graus30-Apr-08 19:18
protectorChristian Graus30-Apr-08 19:18 
GeneralRe: HOW TO CREATE AN INSTANCE OF INTERNET EXPLORER AND HOW TO USE IT? Pin
syamooo30-Apr-08 19:38
syamooo30-Apr-08 19:38 
GeneralRe: HOW TO CREATE AN INSTANCE OF INTERNET EXPLORER AND HOW TO USE IT? Pin
Christian Graus30-Apr-08 19:53
protectorChristian Graus30-Apr-08 19:53 
GeneralRe: HOW TO CREATE AN INSTANCE OF INTERNET EXPLORER AND HOW TO USE IT? Pin
Zoltan Balazs30-Apr-08 20:00
Zoltan Balazs30-Apr-08 20:00 
GeneralRe: HOW TO CREATE AN INSTANCE OF INTERNET EXPLORER AND HOW TO USE IT? Pin
Christian Graus30-Apr-08 20:13
protectorChristian Graus30-Apr-08 20:13 
GeneralRe: HOW TO CREATE AN INSTANCE OF INTERNET EXPLORER AND HOW TO USE IT? Pin
Zoltan Balazs30-Apr-08 20:30
Zoltan Balazs30-Apr-08 20:30 
GeneralRe: HOW TO CREATE AN INSTANCE OF INTERNET EXPLORER AND HOW TO USE IT? Pin
Christian Graus30-Apr-08 20:39
protectorChristian Graus30-Apr-08 20:39 

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.