Compare commits
4 Commits
v0.9.5
...
v0.9.8-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e550c746b | ||
|
|
7fb9b53e62 | ||
|
|
80ce2c6151 | ||
|
|
f2a2f48020 |
104
AboutForm.cs
@@ -4,14 +4,69 @@ using System.Windows.Forms;
|
|||||||
|
|
||||||
namespace AppStore
|
namespace AppStore
|
||||||
{
|
{
|
||||||
public class AboutForm : Form
|
public class AboutUserControl : UserControl
|
||||||
{
|
{
|
||||||
public AboutForm()
|
private PictureBox logo = null!;
|
||||||
|
private Label infoLabel = null!;
|
||||||
|
|
||||||
|
public AboutUserControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.Dock = DockStyle.Fill;
|
||||||
|
this.BackColor = Color.White;
|
||||||
|
this.Padding = new Padding(20);
|
||||||
|
|
||||||
|
// 创建主布局面板
|
||||||
|
TableLayoutPanel mainLayout = new TableLayoutPanel();
|
||||||
|
mainLayout.Dock = DockStyle.Fill;
|
||||||
|
mainLayout.ColumnCount = 1;
|
||||||
|
mainLayout.RowCount = 2;
|
||||||
|
mainLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
|
||||||
|
mainLayout.RowStyles.Add(new RowStyle(SizeType.AutoSize));
|
||||||
|
mainLayout.RowStyles.Add(new RowStyle(SizeType.AutoSize));
|
||||||
|
mainLayout.Padding = new Padding(0, 20, 0, 20);
|
||||||
|
|
||||||
|
// 初始化并添加应用图标
|
||||||
|
logo = new PictureBox();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
logo.Image = Image.FromFile("img/png/kortapp-z.png");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogError($"无法加载应用图标: {ex.Message}");
|
||||||
|
logo.Image = SystemIcons.Application.ToBitmap();
|
||||||
|
}
|
||||||
|
logo.SizeMode = PictureBoxSizeMode.Zoom;
|
||||||
|
logo.Width = 200;
|
||||||
|
logo.Height = 200;
|
||||||
|
logo.Anchor = AnchorStyles.None;
|
||||||
|
logo.Margin = new Padding(0, 0, 0, 20);
|
||||||
|
mainLayout.Controls.Add(logo, 0, 0);
|
||||||
|
|
||||||
|
// 初始化并添加应用信息
|
||||||
|
infoLabel = new Label();
|
||||||
|
infoLabel.Text = "kortapp-z\n版本: 0.9.8\n一个简单、开源的应用商店\nkortapp-z是完全免费的基于.NET8和C++的软件";
|
||||||
|
infoLabel.Font = new Font("Microsoft YaHei", 12);
|
||||||
|
infoLabel.AutoSize = false;
|
||||||
|
infoLabel.Width = 300;
|
||||||
|
infoLabel.Height = 100;
|
||||||
|
infoLabel.TextAlign = ContentAlignment.MiddleCenter;
|
||||||
|
infoLabel.Anchor = AnchorStyles.None;
|
||||||
|
mainLayout.Controls.Add(infoLabel, 0, 1);
|
||||||
|
|
||||||
|
this.Controls.Add(mainLayout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保留原AboutForm作为容器(可选)
|
||||||
|
public class AboutForm : Form
|
||||||
|
{
|
||||||
|
public AboutForm()
|
||||||
{
|
{
|
||||||
this.Text = "关于 kortapp-z";
|
this.Text = "关于 kortapp-z";
|
||||||
this.Size = new Size(500, 400);
|
this.Size = new Size(500, 400);
|
||||||
@@ -19,48 +74,9 @@ namespace AppStore
|
|||||||
this.FormBorderStyle = FormBorderStyle.FixedDialog;
|
this.FormBorderStyle = FormBorderStyle.FixedDialog;
|
||||||
this.MaximizeBox = false;
|
this.MaximizeBox = false;
|
||||||
this.MinimizeBox = false;
|
this.MinimizeBox = false;
|
||||||
|
|
||||||
// 添加应用图标
|
var aboutControl = new AboutUserControl();
|
||||||
PictureBox logo = new PictureBox();
|
this.Controls.Add(aboutControl);
|
||||||
try
|
|
||||||
{
|
|
||||||
logo.Image = Image.FromFile("img/png/kortapp-z.png");
|
|
||||||
logo.SizeMode = PictureBoxSizeMode.Zoom;
|
|
||||||
logo.Width = 200;
|
|
||||||
logo.Height = 200;
|
|
||||||
logo.Location = new Point((this.Width - logo.Width) / 2, 30);
|
|
||||||
this.Controls.Add(logo);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show($"无法加载应用图标: {ex.Message}");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 添加应用信息
|
|
||||||
Label infoLabel = new Label();
|
|
||||||
infoLabel.Text = "kortapp-z\n版本: 0.9.5\n一个简单、开源的应用商店\nkortapp-z是完全免费的基于.NET8和C++的软件";
|
|
||||||
infoLabel.Font = new Font("Microsoft YaHei", 12);
|
|
||||||
infoLabel.AutoSize = false;
|
|
||||||
infoLabel.Width = this.ClientSize.Width - 40;
|
|
||||||
infoLabel.Height = 100;
|
|
||||||
infoLabel.TextAlign = ContentAlignment.MiddleCenter;
|
|
||||||
infoLabel.Location = new Point(
|
|
||||||
20,
|
|
||||||
logo.Bottom + 20
|
|
||||||
);
|
|
||||||
this.Controls.Add(infoLabel);
|
|
||||||
|
|
||||||
// 添加关闭按钮
|
|
||||||
Button closeButton = new Button();
|
|
||||||
closeButton.Text = "关闭";
|
|
||||||
closeButton.Width = 100;
|
|
||||||
closeButton.Height = 40;
|
|
||||||
closeButton.Location = new Point(
|
|
||||||
(this.Width - closeButton.Width) / 2,
|
|
||||||
infoLabel.Bottom + 30
|
|
||||||
);
|
|
||||||
closeButton.Click += (s, e) => this.Close();
|
|
||||||
this.Controls.Add(closeButton);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
116
AppCard.cs
@@ -23,9 +23,14 @@ namespace AppStore
|
|||||||
|
|
||||||
public AppCard()
|
public AppCard()
|
||||||
{
|
{
|
||||||
iconBox = new PictureBox();
|
// 确保关键对象不为null
|
||||||
nameLabel = new Label();
|
iconBox = new PictureBox() { SizeMode = PictureBoxSizeMode.StretchImage };
|
||||||
downloadBtn = new Button();
|
nameLabel = new Label() { Text = string.Empty };
|
||||||
|
downloadBtn = new Button() { Text = "下载" };
|
||||||
|
|
||||||
|
// 确保DownloadManager已初始化
|
||||||
|
var _ = DownloadManager.Instance;
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,25 +246,64 @@ namespace AppStore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 应用计算好的路径
|
// 应用计算好的路径 - 更严格的null检查和异常处理
|
||||||
if (path != null)
|
try
|
||||||
{
|
{
|
||||||
this.Invoke((MethodInvoker)delegate {
|
var safePath = path ?? CalculatePathFallback(Width, Height, 10);
|
||||||
this.Region = new Region(path); // 设置控件区域
|
// 更严格的null检查,包括路径和控件状态
|
||||||
this.Refresh(); // 重绘控件
|
if (safePath != null &&
|
||||||
});
|
safePath.PointCount > 0 &&
|
||||||
|
this.IsHandleCreated &&
|
||||||
|
!this.IsDisposed)
|
||||||
|
{
|
||||||
|
this.Invoke((MethodInvoker)delegate {
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 委托内部再次验证safePath
|
||||||
|
if (safePath != null && safePath.PointCount > 0)
|
||||||
|
{
|
||||||
|
var validPath = safePath; // 确保非null
|
||||||
|
using (var region = new Region(validPath))
|
||||||
|
{
|
||||||
|
this.Region = region;
|
||||||
|
this.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.WriteLine($"创建Region失败: {ex.Message}");
|
||||||
|
this.Region = null;
|
||||||
|
this.Refresh();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.WriteLine($"初始化卡片路径失败: {ex.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private System.Drawing.Drawing2D.GraphicsPath CalculatePathFallback(int width, int height, int radius)
|
private System.Drawing.Drawing2D.GraphicsPath CalculatePathFallback(int width, int height, int radius)
|
||||||
{
|
{
|
||||||
var path = new System.Drawing.Drawing2D.GraphicsPath();
|
try
|
||||||
path.AddArc(0, 0, radius * 2, radius * 2, 180, 90);
|
{
|
||||||
path.AddArc(width - radius * 2, 0, radius * 2, radius * 2, 270, 90);
|
var path = new System.Drawing.Drawing2D.GraphicsPath();
|
||||||
path.AddArc(width - radius * 2, height - radius * 2, radius * 2, radius * 2, 0, 90);
|
path.AddArc(0, 0, radius * 2, radius * 2, 180, 90);
|
||||||
path.AddArc(0, height - radius * 2, radius * 2, radius * 2, 90, 90);
|
path.AddArc(width - radius * 2, 0, radius * 2, radius * 2, 270, 90);
|
||||||
path.CloseFigure();
|
path.AddArc(width - radius * 2, height - radius * 2, radius * 2, radius * 2, 0, 90);
|
||||||
return path;
|
path.AddArc(0, height - radius * 2, radius * 2, radius * 2, 90, 90);
|
||||||
|
path.CloseFigure();
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// 绝对回退方案 - 返回最小有效路径
|
||||||
|
var path = new System.Drawing.Drawing2D.GraphicsPath();
|
||||||
|
path.AddRectangle(new Rectangle(0, 0, width, height));
|
||||||
|
return path;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateDisplay()
|
public void UpdateDisplay()
|
||||||
@@ -270,19 +314,39 @@ namespace AppStore
|
|||||||
|
|
||||||
private void DownloadBtn_Click(object sender, EventArgs e)
|
private void DownloadBtn_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (sender == null || e == null) return;
|
try
|
||||||
if (!string.IsNullOrEmpty(DownloadUrl))
|
|
||||||
{
|
{
|
||||||
try
|
// 更严格的null检查
|
||||||
|
// 更严格的null检查,包括DownloadManager.Instance和其方法
|
||||||
|
// 全面的null和状态检查
|
||||||
|
if (sender == null || e == null ||
|
||||||
|
string.IsNullOrWhiteSpace(DownloadUrl) ||
|
||||||
|
string.IsNullOrWhiteSpace(AppName) ||
|
||||||
|
!this.IsHandleCreated ||
|
||||||
|
this.IsDisposed ||
|
||||||
|
DownloadManager.Instance == null ||
|
||||||
|
DownloadManager.Instance.DownloadItems == null ||
|
||||||
|
DownloadManager.Instance.StartDownload == null)
|
||||||
{
|
{
|
||||||
string fileName = $"{AppName.Replace(" ", "_")}.exe";
|
return;
|
||||||
DownloadManager.Instance.StartDownload(fileName, DownloadUrl);
|
|
||||||
MessageBox.Show($"已开始下载: {AppName}", "下载中", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show($"下载失败: {ex.Message}", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string safeAppName = AppName ?? "未知应用";
|
||||||
|
string fileName = $"{safeAppName.Replace(" ", "_")}.exe";
|
||||||
|
|
||||||
|
DownloadManager.Instance.StartDownload(fileName, DownloadUrl);
|
||||||
|
|
||||||
|
string message = $"已开始下载: {safeAppName}";
|
||||||
|
this.Invoke((MethodInvoker)delegate {
|
||||||
|
MessageBox.Show(this, message, "下载中", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.WriteLine($"下载按钮点击处理失败: {ex.Message}");
|
||||||
|
this.Invoke((MethodInvoker)delegate {
|
||||||
|
MessageBox.Show(this, "下载处理发生错误", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
150
MainForm.cs
@@ -104,8 +104,7 @@ namespace AppStore
|
|||||||
styleButton(btnAbout);
|
styleButton(btnAbout);
|
||||||
btnAbout.Click += (s, e) => {
|
btnAbout.Click += (s, e) => {
|
||||||
Logger.Log("用户点击了'关于'按钮");
|
Logger.Log("用户点击了'关于'按钮");
|
||||||
var aboutForm = new AboutForm();
|
ShowAboutView();
|
||||||
aboutForm.ShowDialog();
|
|
||||||
};
|
};
|
||||||
buttonPanel.Controls.Add(btnAbout);
|
buttonPanel.Controls.Add(btnAbout);
|
||||||
|
|
||||||
@@ -135,8 +134,16 @@ namespace AppStore
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void ShowSettingsView()
|
private void ShowSettingsView()
|
||||||
{
|
{
|
||||||
var settingsForm = new SettingsForm();
|
contentPanel.Controls.Clear();
|
||||||
settingsForm.ShowDialog(); // 以模态对话框形式显示设置窗口
|
var settingsControl = new SettingsUserControl();
|
||||||
|
contentPanel.Controls.Add(settingsControl);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowAboutView()
|
||||||
|
{
|
||||||
|
contentPanel.Controls.Clear();
|
||||||
|
var aboutControl = new AboutUserControl();
|
||||||
|
contentPanel.Controls.Add(aboutControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -201,11 +208,91 @@ namespace AppStore
|
|||||||
// 添加所有应用卡片
|
// 添加所有应用卡片
|
||||||
|
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"XDM",
|
||||||
|
"https://github.com/subhra74/xdm/releases/download/7.2.11/xdm-setup.msi",
|
||||||
|
"img/png/XDM.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"FDM",
|
||||||
|
"https://files2.freedownloadmanager.org/6/latest/fdm_x64_setup.exe",
|
||||||
|
"img/png/FDM.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"ABDM",
|
||||||
|
"https://ghproxy.net/https://github.com/amir1376/ab-download-manager/releases/download/v1.6.4/ABDownloadManager_1.6.4_windows_x64.exe",
|
||||||
|
"img/png/ABDM.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"NDM",
|
||||||
|
"https://ghproxy.net/https://github.com/zs-yg/package/releases/download/v0.7/NeatDM_setup.exe",
|
||||||
|
"img/jpg/NDM.jpg"));
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
"python3.8",
|
"python3.8",
|
||||||
"https://www.python.org/ftp/python/3.8.0/python-3.8.0-amd64.exe",
|
"https://www.python.org/ftp/python/3.8.0/python-3.8.0-amd64.exe",
|
||||||
"img/png/python.png"));
|
"img/png/python.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"Oracle Java8",
|
||||||
|
"https://sdlc-esd.oracle.com/ESD6/JSCDL/jdk/8u451-b10/8a1589aa0fe24566b4337beee47c2d29/jre-8u451-windows-x64.exe?GroupName=JSC&FilePath=/ESD6/JSCDL/jdk/8u451-b10/8a1589aa0fe24566b4337beee47c2d29/jre-8u451-windows-x64.exe&BHost=javadl.sun.com&File=jre-8u451-windows-x64.exe&AuthParam=1750252610_4d0f61835e3392b8f0158398fd5ebd90&ext=.exe",
|
||||||
|
"img/png/java.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"Rust",
|
||||||
|
"https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe",
|
||||||
|
"img/png/rust.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"Ruby",
|
||||||
|
"https://mirror.sjtu.edu.cn/github-release/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.4-2/rubyinstaller-devkit-3.4.4-2-x64.exe",
|
||||||
|
"img/png/ruby.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"D",
|
||||||
|
"https://downloads.dlang.org/releases/2.x/2.111.0/dmd-2.111.0.exe",
|
||||||
|
"img/jpg/D.jpg"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"Go",
|
||||||
|
"https://golang.google.cn/dl/go1.24.4.windows-amd64.msi",
|
||||||
|
"img/png/Go.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"Node.js",
|
||||||
|
"https://nodejs.org/dist/v22.16.0/node-v22.16.0-x64.msi",
|
||||||
|
"img/png/nodejs.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"mingw-64",
|
||||||
|
"https://ghproxy.net/https://github.com/niXman/mingw-builds-binaries/releases/download/15.1.0-rt_v12-rev0/x86_64-15.1.0-release-posix-seh-ucrt-rt_v12-rev0.7z",
|
||||||
|
"img/png/mingw-64.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"Msys2",
|
||||||
|
"https://github.com/msys2/msys2-installer/releases/download/2025-02-21/msys2-x86_64-20250221.exe",
|
||||||
|
"img/png/MSYS2.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
".NET SDK 8.0",
|
||||||
|
"https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/sdk-8.0.411-windows-x64-installer",
|
||||||
|
"img/png/.NET.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"ASP.NET Core 运行时 8.0",
|
||||||
|
"https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/runtime-aspnetcore-8.0.17-windows-x64-installer",
|
||||||
|
"img/png/.NET.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
".NET 桌面运行时 8.0",
|
||||||
|
"https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/runtime-desktop-8.0.17-windows-x64-installer",
|
||||||
|
"img/png/.NET.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
".NET 运行时 8.0",
|
||||||
|
"https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/runtime-8.0.17-windows-x64-installer",
|
||||||
|
"img/png/.NET.png"));
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
"openlist",
|
"openlist",
|
||||||
"https://ghproxy.net/https://github.com/OpenListTeam/OpenList/releases/download/beta/openlist-windows-amd64.zip",
|
"https://ghproxy.net/https://github.com/OpenListTeam/OpenList/releases/download/beta/openlist-windows-amd64.zip",
|
||||||
@@ -226,6 +313,16 @@ namespace AppStore
|
|||||||
"https://vscode.download.prss.microsoft.com/dbazure/download/stable/dfaf44141ea9deb3b4096f7cd6d24e00c147a4b1/VSCodeSetup-x64-1.101.0.exe",
|
"https://vscode.download.prss.microsoft.com/dbazure/download/stable/dfaf44141ea9deb3b4096f7cd6d24e00c147a4b1/VSCodeSetup-x64-1.101.0.exe",
|
||||||
"img/png/vscode.png"));
|
"img/png/vscode.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"vs community 2022",
|
||||||
|
"https://visualstudio.microsoft.com/zh-hans/thank-you-downloading-visual-studio/?sku=Community&channel=Release&version=VS2022&source=VSLandingPage&cid=2030&passive=false",
|
||||||
|
"img/jpg/vs.jpg"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"VSCodium",
|
||||||
|
"https://visualstudio.microsoft.com/zh-hans/thank-you-downloading-visual-studio/?sku=Community&channel=Release&version=VS2022&source=VSLandingPage&cid=2030&passive=false",
|
||||||
|
"img/png/codium_cnl.png"));
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
"7-Zip",
|
"7-Zip",
|
||||||
"https://objects.githubusercontent.com/github-production-release-asset-2e65be/466446150/1645817e-3677-4207-93ff-e62de7e147be?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250613%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250613T035936Z&X-Amz-Expires=300&X-Amz-Signature=5e02d5fc34f45bd8308029c9fc78052007e9475ce0e32775619921cb8f3b83ea&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3D7z2409-x64.exe&response-content-type=application%2Foctet-stream",
|
"https://objects.githubusercontent.com/github-production-release-asset-2e65be/466446150/1645817e-3677-4207-93ff-e62de7e147be?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250613%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250613T035936Z&X-Amz-Expires=300&X-Amz-Signature=5e02d5fc34f45bd8308029c9fc78052007e9475ce0e32775619921cb8f3b83ea&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3D7z2409-x64.exe&response-content-type=application%2Foctet-stream",
|
||||||
@@ -236,6 +333,11 @@ namespace AppStore
|
|||||||
"https://ghproxy.net/https://github.com/zs-yg/package/releases/download/v0.1/7-Zip.7z",
|
"https://ghproxy.net/https://github.com/zs-yg/package/releases/download/v0.1/7-Zip.7z",
|
||||||
"img/png/7ziplogo.png"));
|
"img/png/7ziplogo.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"peazip",
|
||||||
|
"https://ghproxy.net/https://github.com/peazip/PeaZip/releases/download/10.4.0/peazip-10.4.0.WIN64.exe",
|
||||||
|
"img/jpg/peazip.jpg"));
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
"GreenShot",
|
"GreenShot",
|
||||||
"https://objects.githubusercontent.com/github-production-release-asset-2e65be/36756917/239aedb0-7d29-11e7-9f9c-d36ec4466ade?X-Amz-Algorithm=AWS4-HMAC-SSHA256&X-Amz-Credential=releaseassetproduction%2F20250613%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250613T041723Z&X-Amz-Expires=300&X-Amz-Signature=be1ef88a68bbc7065af5111809d11de881022933b44f6d961eb6bd6e6b7e60a8&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3DGreenshot-INSTALLER-1.2.10.6-RELEASE.exe&response-content-type=application%2Foctet-stream",
|
"https://objects.githubusercontent.com/github-production-release-asset-2e65be/36756917/239aedb0-7d29-11e7-9f9c-d36ec4466ade?X-Amz-Algorithm=AWS4-HMAC-SSHA256&X-Amz-Credential=releaseassetproduction%2F20250613%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250613T041723Z&X-Amz-Expires=300&X-Amz-Signature=be1ef88a68bbc7065af5111809d11de881022933b44f6d961eb6bd6e6b7e60a8&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3DGreenshot-INSTALLER-1.2.10.6-RELEASE.exe&response-content-type=application%2Foctet-stream",
|
||||||
@@ -276,26 +378,26 @@ namespace AppStore
|
|||||||
"https://ghproxy.net/https://github.com/mifi/lossless-cut/releases/download/v3.64.0/LosslessCut-win-x64.7z",
|
"https://ghproxy.net/https://github.com/mifi/lossless-cut/releases/download/v3.64.0/LosslessCut-win-x64.7z",
|
||||||
"img/png/LosslessCut.png"));
|
"img/png/LosslessCut.png"));
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
|
||||||
"mingw-64",
|
|
||||||
"https://ghproxy.net/https://github.com/niXman/mingw-builds-binaries/releases/download/15.1.0-rt_v12-rev0/x86_64-15.1.0-release-posix-seh-ucrt-rt_v12-rev0.7z",
|
|
||||||
"img/png/mingw-64.png"));
|
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
"Edge",
|
"Edge",
|
||||||
"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/cb21e6b5-3f63-4df2-bec3-a2015b80dc56/MicrosoftEdgeEnterpriseX64.msi",
|
"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/cb21e6b5-3f63-4df2-bec3-a2015b80dc56/MicrosoftEdgeEnterpriseX64.msi",
|
||||||
"img/jpg/edge.jpg"));
|
"img/jpg/edge.jpg"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"Min",
|
||||||
|
"https://ghproxy.net/https://github.com/minbrowser/min/releases/download/v1.35.0/min-1.35.0-setup.exe",
|
||||||
|
"img/jpg/Min.jpg"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"Brave",
|
||||||
|
"https://ghproxy.net/https://github.com/brave/brave-browser/releases/download/v1.79.126/BraveBrowserSetup.exe",
|
||||||
|
"img/png/brave.png"));
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
"Firefox",
|
"Firefox",
|
||||||
"https://download-ssl.firefox.com.cn/releases-sha2/full/116.0/zh-CN/Firefox-full-latest-win64.exe",
|
"https://download-ssl.firefox.com.cn/releases-sha2/full/116.0/zh-CN/Firefox-full-latest-win64.exe",
|
||||||
"img/jpg/firefox.jpg"));
|
"img/jpg/firefox.jpg"));
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
|
||||||
"Msys2",
|
|
||||||
"https://github.com/msys2/msys2-installer/releases/download/2025-02-21/msys2-x86_64-20250221.exe",
|
|
||||||
"img/png/MSYS2.png"));
|
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
"Mem Reduct",
|
"Mem Reduct",
|
||||||
"https://memreduct.org/files/memreduct-3.5.2-setup.exe",
|
"https://memreduct.org/files/memreduct-3.5.2-setup.exe",
|
||||||
@@ -371,11 +473,6 @@ namespace AppStore
|
|||||||
"https://ghproxy.net/https://github.com/microsoft/TypeScript/releases/download/v5.8.3/typescript-5.8.3.tgz",
|
"https://ghproxy.net/https://github.com/microsoft/TypeScript/releases/download/v5.8.3/typescript-5.8.3.tgz",
|
||||||
""));
|
""));
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
|
||||||
"peazip",
|
|
||||||
"https://ghproxy.net/https://github.com/peazip/PeaZip/releases/download/10.4.0/peazip-10.4.0.WIN64.exe",
|
|
||||||
"img/jpg/peazip.jpg"));
|
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
"Gimp",
|
"Gimp",
|
||||||
"https://mirror.nju.edu.cn/gimp/gimp/v3.0/windows/gimp-3.0.4-setup.exe",
|
"https://mirror.nju.edu.cn/gimp/gimp/v3.0/windows/gimp-3.0.4-setup.exe",
|
||||||
@@ -625,21 +722,6 @@ namespace AppStore
|
|||||||
"Ditto",
|
"Ditto",
|
||||||
"https://ghproxy.net/https://github.com/sabrogden/Ditto/releases/download/3.24.246.0/DittoSetup_64bit_3_24_246_0.exe",
|
"https://ghproxy.net/https://github.com/sabrogden/Ditto/releases/download/3.24.246.0/DittoSetup_64bit_3_24_246_0.exe",
|
||||||
"img/png/Ditto.png"));
|
"img/png/Ditto.png"));
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
|
||||||
"XDM",
|
|
||||||
"https://github.com/subhra74/xdm/releases/download/7.2.11/xdm-setup.msi",
|
|
||||||
"img/png/XDM.png"));
|
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
|
||||||
"FDM",
|
|
||||||
"https://files2.freedownloadmanager.org/6/latest/fdm_x64_setup.exe",
|
|
||||||
"img/png/FDM.png"));
|
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
|
||||||
"ABDM",
|
|
||||||
"https://ghproxy.net/https://github.com/amir1376/ab-download-manager/releases/download/v1.6.4/ABDownloadManager_1.6.4_windows_x64.exe",
|
|
||||||
"img/png/ABDM.png"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private FlowLayoutPanel downloadsFlowPanel = new FlowLayoutPanel();
|
private FlowLayoutPanel downloadsFlowPanel = new FlowLayoutPanel();
|
||||||
|
|||||||
103
SettingsForm.cs
@@ -1,50 +1,53 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace AppStore
|
namespace AppStore
|
||||||
{
|
{
|
||||||
public class SettingsForm : Form
|
public class SettingsUserControl : UserControl
|
||||||
{
|
{
|
||||||
private Button btnCleanLogs;
|
private Button btnCleanLogs;
|
||||||
|
|
||||||
public SettingsForm()
|
public SettingsUserControl()
|
||||||
{
|
{
|
||||||
this.Text = "设置";
|
this.Dock = DockStyle.Fill;
|
||||||
this.Size = new Size(400, 300);
|
this.BackColor = Color.White;
|
||||||
this.StartPosition = FormStartPosition.CenterParent;
|
|
||||||
|
// 设置顶部内边距
|
||||||
btnCleanLogs = new Button();
|
this.Padding = new Padding(0, 30, 0, 0);
|
||||||
btnCleanLogs.Text = "清理日志";
|
|
||||||
btnCleanLogs.Size = new Size(150, 40);
|
btnCleanLogs = new Button();
|
||||||
btnCleanLogs.Location = new Point(120, 100);
|
btnCleanLogs.Text = "清理日志";
|
||||||
btnCleanLogs.Font = new Font("Microsoft YaHei", 10);
|
btnCleanLogs.Size = new Size(150, 40);
|
||||||
btnCleanLogs.Click += (s, e) => CleanLogs();
|
btnCleanLogs.Location = new Point((this.Width - 150) / 2, 50); // 调整Y坐标为50靠近顶部
|
||||||
this.Controls.Add(btnCleanLogs);
|
btnCleanLogs.Font = new Font("Microsoft YaHei", 10);
|
||||||
}
|
btnCleanLogs.Anchor = AnchorStyles.Top; // 添加顶部锚点
|
||||||
|
btnCleanLogs.Click += (s, e) => CleanLogs();
|
||||||
private void CleanLogs()
|
this.Controls.Add(btnCleanLogs);
|
||||||
{
|
}
|
||||||
try
|
|
||||||
{
|
private void CleanLogs()
|
||||||
string logCleanerPath = Path.Combine("resource", "log_cleaner.exe");
|
{
|
||||||
|
try
|
||||||
if (File.Exists(logCleanerPath))
|
{
|
||||||
{
|
string logCleanerPath = Path.Combine("resource", "log_cleaner.exe");
|
||||||
Process.Start(logCleanerPath);
|
|
||||||
MessageBox.Show("日志清理程序已启动", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
if (File.Exists(logCleanerPath))
|
||||||
}
|
{
|
||||||
else
|
Process.Start(logCleanerPath);
|
||||||
{
|
MessageBox.Show("日志清理程序已启动", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
MessageBox.Show("日志清理程序未找到", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
}
|
||||||
}
|
else
|
||||||
}
|
{
|
||||||
catch (Exception ex)
|
MessageBox.Show("日志清理程序未找到", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
{
|
}
|
||||||
Logger.LogError("清理日志时出错", ex);
|
}
|
||||||
MessageBox.Show($"清理日志时出错: {ex.Message}", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
catch (Exception ex)
|
||||||
}
|
{
|
||||||
}
|
Logger.LogError("清理日志时出错", ex);
|
||||||
}
|
MessageBox.Show($"清理日志时出错: {ex.Message}", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
BIN
img/jpg/D.jpg
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
img/jpg/Min.jpg
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
img/jpg/NDM.jpg
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
img/jpg/vs.jpg
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
img/png/Ditto.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
img/png/Go.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
img/png/SSM.png
Normal file
|
After Width: | Height: | Size: 86 KiB |
BIN
img/png/brave.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
img/png/codium_cnl.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
img/png/java.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
img/png/nodejs.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
img/png/openark.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
img/png/ruby.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
img/png/rust.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |