/ Published in: C#
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
using System; using System.IO; using System.Runtime.Serialization.Formatters.Binary; namespace ConnectionClasses { [Serializable] public abstract class Connection { public int ID { get; set; } public String Name { get; set; } public string SerializeToBase64String() { return Connection.SerializeToBase64String(this); } public static string SerializeToBase64String(Connection connection) { { ms.Seek(0, SeekOrigin.Begin); return Convert.ToBase64String(ms.ToArray()); } } public static Connection DeserializeFromBase64String(String str) { { ms.Seek(0, SeekOrigin.Begin); } } } }