开机加载配置:
string base64=Properties.Settings.Default.KEY;
KEY_S key = B64Serialize.StringToObject<KEY_S>(base64);
KEY.appkey = key.appkey;
KEY.password = key.password;
配置类:
[Serializable]
class KEY_S
{
public string appkey = “”;
public string password = “”;
}
更新配置信息:
string base64 = “”;
KEY_S key = new KEY_S();
key.appkey = txt_key.Text;
key.password = txt_pwd.Text;
base64 = B64Serialize.ObjectToString<KEY_S>(key);
KEY.appkey = key.appkey;
KEY.password = key.password;
Properties.Settings.Default.KEY = base64;
Properties.Settings.Default.Save();