C# FileInput to class

Started by
3 comments, last by Pipo DeClown 19 years, 11 months ago
Is it possible to read into a class? (Which was possible in C) -- You''re Welcome, Rick Wong - sitting in his chair doing the most time-consuming thing..
Advertisement
C doesn''t have classes. Therefore reading into a class is not possible in C.

You can deserialize an object from a stream in C#. Look up the formatter classes: BinaryFormatter and SoapFormatter.
Thanks, I meant C++ by the way.

--
You''re Welcome,
Rick Wong
- sitting in his chair doing the most time-consuming thing..
and if you just want standard binary serialization, all you need to add to a class is the [ Serializable ] attribute.

But there are other attributes to allow custom serialization (or implement the ISerializable interface) ... or roll your own system.
Thanks Xai, I''ll read up on that!

--
You''re Welcome,
Rick Wong
- sitting in his chair doing the most time-consuming thing..

This topic is closed to new replies.

Advertisement