Skip to content

Commit

Permalink
fix: 删除旧页面,添加了隐私协议并为部分页面添加了注释
Browse files Browse the repository at this point in the history
  • Loading branch information
Shizuku-Nanami committed Sep 29, 2024
1 parent 0b81c7c commit fc4e235
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 116 deletions.
18 changes: 0 additions & 18 deletions SYSTools/Dialog/BackImageNew.xaml

This file was deleted.

29 changes: 0 additions & 29 deletions SYSTools/Dialog/BackImageNew.xaml.cs

This file was deleted.

19 changes: 0 additions & 19 deletions SYSTools/Dialog/BackImageOld.xaml

This file was deleted.

30 changes: 0 additions & 30 deletions SYSTools/Dialog/BackImageOld.xaml.cs

This file was deleted.

4 changes: 2 additions & 2 deletions SYSTools/Pages/About.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
<Button x:Name="QQ" Content="QQ群" Margin="30,245,0,0" VerticalAlignment="Top" Width="135" Height="33" Click="QQ_Click"/>
<Button x:Name="Web" Content="官网" Margin="30,300,0,0" Width="135" Height="33" VerticalAlignment="Top" Click="Web_Click"/>
<Button x:Name="Github" Content="Github" Margin="30,355,0,0" Width="135" Height="33" VerticalAlignment="Top" Click="Github_Click"/>
<TextBlock TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="30,0,0,65" FontSize="15" Text="第一次写类似的软件 虽然代码只是能用的阶段 有问题还请提交Issue"/>
<TextBlock TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="30,0,0,40" FontSize="15" Text="该有的都会有的 时间问题(Flag)"/>
<!--<Button x:Name="Agreement" Content="用户协议" VerticalAlignment="Bottom" FontSize="15" VerticalContentAlignment="Top" Margin="20,0,0,35" Background="{x:Null}" Click="Agreement_Click" BorderBrush="{x:Null}" />-->
<Button x:Name="Privacy" Content="隐私协议" VerticalAlignment="Bottom" FontSize="15" VerticalContentAlignment="Top" Margin="120,0,0,35" Background="{x:Null}" Click="Privacy_Click" BorderBrush="{x:Null}"/>
<TextBlock TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="10,0,0,10" FontSize="15" Text="©2018-2024 Hikarisame Technology Studio. All Rights Reserved."/>

<Button x:Name="Update" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="30,0,0,130" Width="150" Height="60" BorderThickness="0,0,0,0" Background="{x:Null}" Focusable="False" ToolTip="软件升级" Panel.ZIndex="1" Padding="0,0,0,0" Click="Update_Click" BorderBrush="#66000000">
Expand Down
56 changes: 52 additions & 4 deletions SYSTools/Pages/About.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System;
using AutoUpdaterDotNET;
using System;
using System.Diagnostics;
using System.IO;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using AutoUpdaterDotNET;
using iNKORE.UI.WPF.Modern;
using System.Windows.Forms;
using SYSTools.Dialog;

namespace SYSTools.Pages
Expand Down Expand Up @@ -49,7 +51,7 @@ private async void Update_Click(object sender, RoutedEventArgs e)
response.EnsureSuccessStatusCode();
string webCode = await response.Content.ReadAsStringAsync();

Version currentVersion = Application.ResourceAssembly.GetName().Version;
Version currentVersion = System.Windows.Application.ResourceAssembly.GetName().Version;
Version webVersion = new Version(webCode);

if (currentVersion >= webVersion)
Expand Down Expand Up @@ -84,5 +86,51 @@ private async void Tool_Update_Click(object sender, RoutedEventArgs e)
Process.Start(ToolsExecutablePath);
}
}

private void Agreement_Click(object sender, RoutedEventArgs e)
{

}

private async void Privacy_Click(object sender, RoutedEventArgs e)
{
// 从URL下载txt内容
string url = "https://systools.hksstudio.work/Agree_Privacy/Privacy.txt";
string txtContent = await GetTxtFromUrlAsync(url);

// 创建并显示ContentDialog
iNKORE.UI.WPF.Modern.Controls.ContentDialog dialog = new iNKORE.UI.WPF.Modern.Controls.ContentDialog
{
Title = "隐私协议",
Content = new System.Windows.Controls.TextBox
{
Text = txtContent,
AcceptsReturn = true,
AcceptsTab = true,
TextWrapping = TextWrapping.Wrap,
VerticalScrollBarVisibility = ScrollBarVisibility.Auto
},

CloseButtonText = "关闭",
PrimaryButtonText = "打开Url查看",
DefaultButton = iNKORE.UI.WPF.Modern.Controls.ContentDialogButton.Close
};

var result = await dialog.ShowAsync();
// 设定Url跳转地址
if (result == iNKORE.UI.WPF.Modern.Controls.ContentDialogResult.Primary)
{
Process.Start(new ProcessStartInfo("https://systools.hksstudio.work/privacy.html") { UseShellExecute = true });
}
}
// 获取txt文件内容,GB2312编码
private async Task<string> GetTxtFromUrlAsync(string url)
{
using (HttpClient client = new HttpClient())
{
byte[] bytes = await client.GetByteArrayAsync(url);
return Encoding.GetEncoding("GB2312").GetString(bytes);
}
}
}
}
14 changes: 0 additions & 14 deletions SYSTools/SYSTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@
<Compile Include="Dialog\AdbDialog.xaml.cs">
<DependentUpon>AdbDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Dialog\BackImageNew.xaml.cs">
<DependentUpon>BackImageNew.xaml</DependentUpon>
</Compile>
<Compile Include="Dialog\BackImageOld.xaml.cs">
<DependentUpon>BackImageOld.xaml</DependentUpon>
</Compile>
<Compile Include="Dialog\NoUpdate.xaml.cs">
<DependentUpon>NoUpdate.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -131,14 +125,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Dialog\BackImageNew.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Dialog\BackImageOld.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Dialog\NoUpdate.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down

0 comments on commit fc4e235

Please sign in to comment.