Skip to content

Commit

Permalink
Ver 2.4.0-Alpha.2: Fixed Avatar Fetching.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shiroiame-Kusu committed Dec 26, 2024
1 parent 0a7832d commit 8070a4e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
36 changes: 14 additions & 22 deletions Kairo/Dashboard/Home.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using Wpf.Ui.Controls;
using Kairo.Utils;
using Kairo.Dashboard;
using System.Windows.Threading;
using System.Text.RegularExpressions;
using System.IO;
using Kairo.Extensions;
using System.Security.Cryptography;
using Markdig;
using System.Windows.Controls;
using System.Text;
using HtmlAgilityPack;
using System.Linq;
using System.Windows;
using RestSharp;
using System.Threading.Tasks;


Expand Down Expand Up @@ -114,7 +107,6 @@ private async void FetchAnnouncement()
}
}
catch (Exception _) {
CrashInterception.ShowException(_);
}
}
private async void InitializeWebView(string a)
Expand Down Expand Up @@ -164,23 +156,23 @@ private async void RefreshAvatar()
}

File.Delete(path);
using (FileStream fileStream = new(path, FileMode.Create))
{
byte[] bytes = new byte[Avatar.Length];
Avatar.Read(bytes, 0, bytes.Length);
// 设置当前流的位置为流的开始
Avatar.Seek(0, SeekOrigin.Begin);

}
using (FileStream fileStream = new(path, FileMode.Create))
{
byte[] bytes = new byte[Avatar.Length];
Avatar.Read(bytes, 0, bytes.Length);
// 设置当前流的位置为流的开始
Avatar.Seek(0, SeekOrigin.Begin);

// 把 byte[] 写入文件
// 把 byte[] 写入文件

BinaryWriter bw = new BinaryWriter(fileStream);
bw.Write(bytes);
bw.Close();
fileStream.Close();
}
ApplyAvatar();
BinaryWriter bw = new BinaryWriter(fileStream);
bw.Write(bytes);
bw.Close();
fileStream.Close();
}

ApplyAvatar();

}

Expand Down
8 changes: 3 additions & 5 deletions Kairo/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;

Expand All @@ -12,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("LoCyanTeam")]
[assembly: AssemblyProduct("Kairo")]
[assembly: AssemblyCopyright("Copyright © 2021 - 2023 杭州樱芸网络科技有限公司 All rights reserved.")]
[assembly: AssemblyCopyright("Copyright © 2021 - 2025 杭州樱芸网络科技有限公司 All rights reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down Expand Up @@ -51,5 +49,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.0")]
[assembly: AssemblyFileVersion("2.3.0.0")]
[assembly: AssemblyVersion("2.4.0")]
[assembly: AssemblyFileVersion("2.4.0.0")]

0 comments on commit 8070a4e

Please sign in to comment.