简体   繁体   中英

How to GetByte from Object without serialize?

I want to save properties of controls that user change at runtime.(.Net windows form application)

I just using BinaryFormatter to serialize object, It's work but some properties not serialize, therefore i want to save object as binary

Note: I using third-party component without source code

Could you please help me?

Serializing the object is saving it "as binary". If you're looking for a straight memory dump, you're out of luck - that's just not realistic in .NET.

If serialization doesn't work out of the box, you may need to serialize what you can and then bolt on extra information about the properties that aren't currently being serialized. I would personally be slightly worried at how brittle this solution could be though - there may be very good reasons for the properties not being serialized. (.NET binary serialization is pretty brittle to start with...)

Why not contact the author of the component and ask for their advice? They're likely to know more about any quirks you might run into than we are.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM