| | |
| | | /// <summary> |
| | | /// 获取自己+其他成员信息 |
| | | /// </summary> |
| | | /// <param name="doorlockMac">门锁Mac</param> |
| | | /// <param name="doorlockMac">门锁Mac+端口</param> |
| | | /// <returns></returns> |
| | | public static async System.Threading.Tasks.Task<List<MembershipIfon>> AllMembers(string doorlockMac) |
| | | { |
| | |
| | | { |
| | | string s = null; |
| | | var str = await WebClientAsync(0, CommonPage.RequestHttpsHost + "/App/GetHomePager");//不同区域域名前缀不一样 |
| | | // var str = await WebClientAsync(0, "https://global.hdlcontrol.com/HangZhouHdlCloudApi/App/GetHomePager"); |
| | | // var str = await WebClientAsync(0, "https://global.hdlcontrol.com/HangZhouHdlCloudApi/App/GetHomePager"); |
| | | var jObject = JObject.Parse(str); |
| | | if (jObject == null || jObject["StateCode"].ToString() != "Success") |
| | | { |
| | |
| | | postValues.Add("RequestVersion", CommonPage.RequestVersion); |
| | | postValues.Add("LoginAccessToken", residential.Token); |
| | | postValues.Add("HomeId", residential.Id); |
| | | postValues.Add("DoorLockId", residential.doorlockmac);//门锁Mac |
| | | postValues.Add("DoorLockId", residential.doorlockmac);//门锁Mac+端口 |
| | | postValues.Add("IsOtherAccountCtrl", residential.IsOtherAccountCtrl.ToString()); |
| | | postValues.Add("PageSetting.PageSize", Int32.MaxValue.ToString()); |
| | | } |
| | |
| | | public static UserCenter.MemberInfoRes UserMemberInfoRes = null; |
| | | #endregion |
| | | |
| | | #region 存取本地文件的方法 ---暂时不用合并该方法--- |
| | | /// <summary> |
| | | /// 文件保存 |
| | | /// </summary> |
| | | /// <param name="FileName">文件路径</param> |
| | | /// <param name="obj">需要序列化数据</param> |
| | | public static void SaveLocalFile(string FileName, object obj) |
| | | { |
| | | //先序列化数据; |
| | | var data = Newtonsoft.Json.JsonConvert.SerializeObject(obj); |
| | | //数据转换为字节流; |
| | | var byteData = System.Text.Encoding.UTF8.GetBytes(data); |
| | | //写入数据; |
| | | Shared.IO.FileUtils.WriteFileByBytes(FileName, byteData); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 文件读取 |
| | | /// </summary> |
| | | /// <param name="FileName">文件路径</param> |
| | | /// <returns></returns> |
| | | public static string ReadLocalFile(string FileName) |
| | | { |
| | | if (System.IO.File.Exists(FileName) == false) |
| | | { |
| | | ///判断是否有文件; |
| | | return null; |
| | | } |
| | | //读出保存该路径的文件; |
| | | var varByte = Shared.IO.FileUtils.ReadFile(FileName); |
| | | //字节流转换为字符串; |
| | | return System.Text.Encoding.UTF8.GetString(varByte); |
| | | } |
| | | #endregion |
| | | } |
| | | } |