static public void Deserialize(ref uVK.UserDatas datas) { IFormatter formatter = new BinaryFormatter(); using (Stream stream = new FileStream(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\uVK\\UserDatas\\data.bin", FileMode.Open)) { datas = (uVK.UserDatas)formatter.Deserialize(stream); } }
public static void Serialize(uVK.UserDatas datas) { IFormatter formatter = new BinaryFormatter(); Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\uVK\\UserDatas\\"); using (Stream stream = new FileStream(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\uVK\\UserDatas\\data.bin", FileMode.Create)) { formatter.Serialize(stream, datas); } }
public VkDatas() { datas = new uVK.UserDatas(); Cache = new SaveAudios(); }