2013년 11월 16일 토요일

[C#] Serialization Example ( Directly Write and Read Object as File )

For serializtion, need something

To make serializable object

namespace

  • using System.Runtime.Serialization

class

  • System.Runtime.Serialization.Serializable Attribute
  • System.Runtime.Serialization.ISerializable Interface


To Write or Read

namespace

  • using System.Runtime.Serialization.Formatters.Binary

class

  • System.Runtime.Serialization.Formatters.Binary.BinaryFormatter Class


Source




Pictures

class Human





















class Pet





















static void Main()



















Result


댓글 없음:

댓글 쓰기