wxr
2023-06-06 592974441a4df95fffd9167c90192da1a390b1c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
//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
 
//    }
//}