Skip to content

GERD0GDU/XmlSerializer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ioCode.Serialization

C# types serialization library.
Serializes and deserializes objects into and from XML documents.

Classes

ioCode.Serialization library has two serialization classes

  • XmlSerializer<T> Xml serialization object to serialize custom types
  • BinSerializer<T> Bin serialization object for XML-based serialization of custom types. The serialized output file is encrypted.

XmlSerializer<T>

Write to file

  Product product = new Product();
  product.Name = "Product1";
  bool isSuccess = XmlSerializer<Product>.WriteFile(@"C:\users\[user]\documents\product.xml", product);
  MessageBox.Show(isSuccess ? "Success" : "Fail");

Read from file

  Product product = XmlSerializer<Product>.ReadFile(@"C:\users\[user]\documents\product.xml");
  MessageBox.Show((product != null) ? "Success" : "Fail");

BinSerializer<T>

Write to file

  Product product = new Product();
  product.Name = "Product1";
  bool isSuccess = BinSerializer<Product>.WriteFile(@"C:\users\[user]\documents\product.bin", "password123", product);
  MessageBox.Show(isSuccess ? "Success" : "Fail");

Read from file

  Product product = BinSerializer<Product>.ReadFile(@"C:\users\[user]\documents\product.bin", "password123");
  MessageBox.Show((product != null) ? "Success" : "Fail");

About

Serializes and deserializes objects into and from XML documents.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages