| | |
| | | try |
| | | { |
| | | var headImageString = dataStr.GetValue("HeadImage").ToString(); |
| | | var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(headImageString); |
| | | var headImageBytes = Newtonsoft.Json.JsonConvert.DeserializeObject<byte[]>(jsonString); |
| | | MainPage.LoginUser.headImagePageBytes = headImageBytes; |
| | | var filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/", "headImage.png"); |
| | | |
| | | fs = new FileStream(filePath, FileMode.Create, FileAccess.Write); |
| | | fs.Write(headImageBytes, 0, headImageBytes.Length); |
| | | fs.Flush(); |
| | | MainPage.LoginUser.headImagePagePath = filePath; |
| | | if (!string.IsNullOrEmpty(headImageString)) |
| | | { |
| | | var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(headImageString); |
| | | var headImageBytes = Newtonsoft.Json.JsonConvert.DeserializeObject<byte[]>(jsonString); |
| | | MainPage.LoginUser.headImagePageBytes = headImageBytes; |
| | | var filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/", "headImage.png"); |
| | | fs = new FileStream(filePath, FileMode.Create, FileAccess.Write); |
| | | fs.Write(headImageBytes, 0, headImageBytes.Length); |
| | | fs.Flush(); |
| | | MainPage.LoginUser.headImagePagePath = filePath; |
| | | } |
| | | } catch (Exception ex) |
| | | { |
| | | MainPage.Log($"download headImage error : {ex.Message}"); |