public static bool SetChooser(Chooser chooser) { string path = string.Format("{0}\\Choose.bin", System.Windows.Forms.Application.StartupPath); if (!File.Exists(path)) { return false; } ClassLibrary.Encrypt_Decrypt.Encrypt_Decrypt ed = new ClassLibrary.Encrypt_Decrypt.Encrypt_Decrypt(path); ed.Serialize(chooser); return true; }
public static Chooser GetChooser() { Chooser chooser = new Chooser(); string path = string.Format("{0}\\Choose.bin", System.Windows.Forms.Application.StartupPath); if (!File.Exists(path)) { return null; } //Chooser chooser = new Chooser(); ClassLibrary.Encrypt_Decrypt.Encrypt_Decrypt ed = new ClassLibrary.Encrypt_Decrypt.Encrypt_Decrypt(path); chooser = (Chooser)ed.DeSerialize(); return chooser; }