New file |
| | |
| | | //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<DB_AccountList>(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<DB_Account> List = new List<DB_Account>(); |
| | | |
| | | // public DB_Account CurAccount |
| | | // { |
| | | // get |
| | | // { |
| | | // var temp = List.Find((obj) => obj.UserId == UserInfo.Current.ID); |
| | | // if (temp == null) |
| | | // { |
| | | // temp = new DB_Account(); |
| | | // } |
| | | // return temp; |
| | | // } |
| | | // } |
| | | |
| | | // /// <summary> |
| | | // /// 根目录 |
| | | // /// </summary> |
| | | // string RootPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/"; |
| | | // /// <summary> |
| | | // /// 读取userInfo文件 |
| | | // /// </summary> |
| | | // /// <returns></returns> |
| | | // 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 |
| | | // { |
| | | |
| | | // } |
| | | // } |
| | | |
| | | // } |
| | | // /// <summary> |
| | | // /// 保存userInfo |
| | | // /// </summary> |
| | | // /// <param name="bytes"></param> |
| | | // /// <returns></returns> |
| | | // 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 |
| | | // { |
| | | // /// <summary> |
| | | // /// 用户ID |
| | | // /// </summary> |
| | | // public string UserId = ""; |
| | | // /// <summary> |
| | | // /// 用户手机号码 |
| | | // /// </summary> |
| | | // public string userMobileInfo = ""; |
| | | // /// <summary> |
| | | // /// 用户邮箱信息 |
| | | // /// </summary> |
| | | // public string userEmailInfo = ""; |
| | | |
| | | // public DateTime lastLogin = DateTime.Now; |
| | | |
| | | // public bool ConsentAgreement = false; |
| | | |
| | | |
| | | // #region 新增保存参数 |
| | | // /// <summary> |
| | | // /// 账号注册服务器信息 |
| | | // /// </summary> |
| | | // public string RequestHttpsHost = "https://china.hdlcontrol.com"; |
| | | // /// <summary> |
| | | // /// |
| | | // /// </summary> |
| | | // public GlobalRegionListRes GlobalRegion; |
| | | |
| | | // /// <summary> |
| | | // /// 是否同意协议 |
| | | // /// </summary> |
| | | // public bool isAgreePrivacyPolicy; |
| | | |
| | | // /// <summary> |
| | | // /// 忽略更新的版本号 |
| | | // /// </summary> |
| | | // public string IgnoreUpdateVersion = string.Empty; |
| | | |
| | | // /// <summary> |
| | | // /// 信息推送标记 |
| | | // /// </summary> |
| | | // public string PushDeviceToken; |
| | | // /// <summary> |
| | | // /// phoneName |
| | | // /// </summary> |
| | | // public string PhoneName; |
| | | // /// <summary> |
| | | // /// 添加推送Token成功时返回的Id |
| | | // /// </summary> |
| | | // public string PushId; |
| | | // #endregion |
| | | |
| | | // } |
| | | //} |