//using System; //using System.Collections.Generic; //using System.IO; //using HDL_ON.DAL.Server; //namespace HDL_ON.Common //{ // public class DB_AccountList // { // static DB_AccountList _AccountList; // public static DB_AccountList Accounts // { // get // { // if (_AccountList == null) // { // try // { // DB_AccountList temp = Newtonsoft.Json.JsonConvert.DeserializeObject(System.Text.Encoding.UTF8.GetString(Common.FileUtlis.Files.ReadUserInfo())); // if (temp == null) // { // _AccountList = new DB_AccountList() { }; // Utlis.WriteLine("UserInfo null"); // } // else // { // _AccountList = temp; // Utlis.WriteLine("UserInfo Current"); // } // } // catch // { // _AccountList = new DB_AccountList() { }; // Utlis.WriteLine("UserInfo null"); // } // } // return _AccountList; // } // } // public List List = new List(); // public DB_Account CurAccount // { // get // { // var temp = List.Find((obj) => obj.UserId == UserInfo.Current.ID); // if (temp == null) // { // temp = new DB_Account(); // } // return temp; // } // } // /// // /// 根目录 // /// // string RootPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/"; // /// // /// 读取userInfo文件 // /// // /// // public byte[] ReadUserInfo() // { // var fileName = "UserInfo_File"; // FileStream fs = null; // try // { // if (File.Exists(Path.Combine(RootPath, fileName))) // { // fs = new FileStream(Path.Combine(RootPath, fileName), FileMode.Open, FileAccess.Read); // } // else if (File.Exists(fileName)) // { // fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); // } // else // { // return new byte[0]; // } // byte[] bytes = new byte[fs.Length]; // fs.Read(bytes, 0, bytes.Length); // return bytes; // } // catch // { // return new byte[0]; // } // finally // { // try // { // if (fs != null) // { // fs.Close(); // } // } // catch // { // } // } // } // /// // /// 保存userInfo // /// // /// // /// // public bool WirteUserinfo(byte[] bytes) // { // var fileName = "UserInfo_File"; // FileStream fs = null; // try // { // fs = new FileStream(Path.Combine(RootPath, fileName), FileMode.Create, FileAccess.Write); // fs.Write(bytes, 0, bytes.Length); // fs.Flush(); // MainPage.Log("SaveFile:" + fileName); // return true; // } // catch (Exception ex) // { // MainPage.Log("FileUtiles Code 113:" + ex.ToString()); // return false; // } // finally // { // try // { // if (fs != null) // { // fs.Close(); // } // } // catch (Exception ex) // { // MainPage.Log("FileUtils Code 121 :" + ex.ToString()); // } // } // } // } // public class DB_Account // { // /// // /// 用户ID // /// // public string UserId = ""; // /// // /// 用户手机号码 // /// // public string userMobileInfo = ""; // /// // /// 用户邮箱信息 // /// // public string userEmailInfo = ""; // public DateTime lastLogin = DateTime.Now; // public bool ConsentAgreement = false; // #region 新增保存参数 // /// // /// 账号注册服务器信息 // /// // public string RequestHttpsHost = "https://china.hdlcontrol.com"; // /// // /// // /// // public GlobalRegionListRes GlobalRegion; // /// // /// 是否同意协议 // /// // public bool isAgreePrivacyPolicy; // /// // /// 忽略更新的版本号 // /// // public string IgnoreUpdateVersion = string.Empty; // /// // /// 信息推送标记 // /// // public string PushDeviceToken; // /// // /// phoneName // /// // public string PhoneName; // /// // /// 添加推送Token成功时返回的Id // /// // public string PushId; // #endregion // } //}