Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c25cd37755 | ||
|
|
6536e99eec | ||
|
|
0ac791653e | ||
|
|
45ca7909fd | ||
|
|
60b459c74a | ||
|
|
295af72e4f | ||
|
|
474f3ecfbc | ||
|
|
ab37a33443 | ||
|
|
7f8a12c26a | ||
|
|
0f50193705 | ||
|
|
bc01dad692 | ||
|
|
0b58ee3f2e | ||
|
|
51974beaa8 | ||
|
|
9faa32e985 | ||
|
|
197f9ae76f | ||
|
|
7d11096f8a | ||
|
|
f8d02d44c1 | ||
|
|
c22b653ce0 | ||
|
|
4b27d2e1dc | ||
|
|
0f578d56d4 | ||
|
|
d36a367147 | ||
|
|
2c8ce29b3d | ||
|
|
efe7d16f96 |
38
.github/ISSUE_TEMPLATE/bug反馈.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
name: Bug反馈
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: zs-yg
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Desktop (please complete the following information):**
|
||||||
|
- OS: [e.g. iOS]
|
||||||
|
- Browser [e.g. chrome, safari]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
|
**Smartphone (please complete the following information):**
|
||||||
|
- Device: [e.g. iPhone6]
|
||||||
|
- OS: [e.g. iOS8.1]
|
||||||
|
- Browser [e.g. stock browser, safari]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
10
.github/ISSUE_TEMPLATE/功能建议.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
name: 功能建议
|
||||||
|
about: 给我们一些修改建议
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
20
.github/ISSUE_TEMPLATE/新功能添加请求🥰🥰🥰.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: "新功能添加请求\U0001F970\U0001F970\U0001F970"
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
@@ -50,7 +50,7 @@ namespace AppStore
|
|||||||
|
|
||||||
// 初始化并添加应用信息
|
// 初始化并添加应用信息
|
||||||
infoLabel = new Label();
|
infoLabel = new Label();
|
||||||
infoLabel.Text = "kortapp-z\n版本: 1.0.0\n作者: zs-yg\n一个简单、开源的应用商店\nkortapp-z是完全免费\n基于.NET8和C++的软件";
|
infoLabel.Text = "kortapp-z\n版本: 1.0.3\n作者: zs-yg\n一个简单、开源的应用商店\nkortapp-z是完全免费\n基于.NET8和C++的软件";
|
||||||
infoLabel.Font = new Font("Microsoft YaHei", 12);
|
infoLabel.Font = new Font("Microsoft YaHei", 12);
|
||||||
infoLabel.AutoSize = false;
|
infoLabel.AutoSize = false;
|
||||||
infoLabel.Width = 300;
|
infoLabel.Width = 300;
|
||||||
|
|||||||
708
AppCard.cs
@@ -1,353 +1,355 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
|
|
||||||
namespace AppStore
|
namespace AppStore
|
||||||
{
|
{
|
||||||
public class AppCard : UserControl
|
public class AppCard : UserControl
|
||||||
{
|
{
|
||||||
private PictureBox iconBox;
|
private PictureBox iconBox;
|
||||||
private Label nameLabel;
|
private Label nameLabel;
|
||||||
private Button downloadBtn;
|
private Button downloadBtn;
|
||||||
private static readonly ConcurrentDictionary<string, System.Drawing.Drawing2D.GraphicsPath> PathCache =
|
private static readonly ConcurrentDictionary<string, System.Drawing.Drawing2D.GraphicsPath> PathCache =
|
||||||
new ConcurrentDictionary<string, System.Drawing.Drawing2D.GraphicsPath>();
|
new ConcurrentDictionary<string, System.Drawing.Drawing2D.GraphicsPath>();
|
||||||
|
|
||||||
public string AppName { get; set; } = string.Empty;
|
public string AppName { get; set; } = string.Empty;
|
||||||
public Image AppIcon { get; set; } = SystemIcons.Application.ToBitmap();
|
public Image AppIcon { get; set; } = SystemIcons.Application.ToBitmap();
|
||||||
public string DownloadUrl { get; set; } = string.Empty;
|
public string DownloadUrl { get; set; } = string.Empty;
|
||||||
|
public bool ShowDownloadButton { get; set; } = true;
|
||||||
public AppCard()
|
|
||||||
{
|
public AppCard()
|
||||||
// 确保关键对象不为null
|
{
|
||||||
iconBox = new PictureBox() { SizeMode = PictureBoxSizeMode.StretchImage };
|
// 确保关键对象不为null
|
||||||
nameLabel = new Label() { Text = string.Empty };
|
iconBox = new PictureBox() { SizeMode = PictureBoxSizeMode.StretchImage };
|
||||||
downloadBtn = new Button() { Text = "下载" };
|
nameLabel = new Label() { Text = string.Empty };
|
||||||
|
downloadBtn = new Button() { Text = "下载" };
|
||||||
// 确保DownloadManager已初始化
|
|
||||||
var _ = DownloadManager.Instance;
|
// 确保DownloadManager已初始化
|
||||||
|
var _ = DownloadManager.Instance;
|
||||||
InitializeComponent();
|
|
||||||
}
|
InitializeComponent();
|
||||||
|
}
|
||||||
private static readonly ConcurrentDictionary<string, System.Drawing.Drawing2D.GraphicsPath> BorderCache =
|
|
||||||
new ConcurrentDictionary<string, System.Drawing.Drawing2D.GraphicsPath>();
|
private static readonly ConcurrentDictionary<string, System.Drawing.Drawing2D.GraphicsPath> BorderCache =
|
||||||
|
new ConcurrentDictionary<string, System.Drawing.Drawing2D.GraphicsPath>();
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
private void InitializeComponent()
|
||||||
this.Size = new Size(240, 200);
|
{
|
||||||
this.BackColor = Color.White;
|
this.Size = new Size(240, 200);
|
||||||
this.Padding = new Padding(10);
|
this.BackColor = Color.White;
|
||||||
|
this.Padding = new Padding(10);
|
||||||
// 异步初始化卡片路径和边框
|
|
||||||
Task.Run(() => {
|
// 异步初始化卡片路径和边框
|
||||||
InitializeCardPath();
|
Task.Run(() => {
|
||||||
InitializeBorder();
|
InitializeCardPath();
|
||||||
});
|
InitializeBorder();
|
||||||
|
});
|
||||||
// 应用图标
|
|
||||||
iconBox = new PictureBox();
|
// 应用图标
|
||||||
iconBox.Size = new Size(80, 80);
|
iconBox = new PictureBox();
|
||||||
iconBox.Location = new Point((Width - 80) / 2, 15);
|
iconBox.Size = new Size(80, 80);
|
||||||
iconBox.SizeMode = PictureBoxSizeMode.StretchImage;
|
iconBox.Location = new Point((Width - 80) / 2, 15);
|
||||||
this.Controls.Add(iconBox);
|
iconBox.SizeMode = PictureBoxSizeMode.StretchImage;
|
||||||
|
this.Controls.Add(iconBox);
|
||||||
// 应用名称
|
|
||||||
nameLabel = new Label();
|
// 应用名称
|
||||||
nameLabel.AutoSize = false;
|
nameLabel = new Label();
|
||||||
nameLabel.Size = new Size(Width - 20, 40);
|
nameLabel.AutoSize = false;
|
||||||
nameLabel.Location = new Point(10, 100);
|
nameLabel.Size = new Size(Width - 20, 40);
|
||||||
nameLabel.Font = new Font("Microsoft YaHei", 10, FontStyle.Bold);
|
nameLabel.Location = new Point(10, 100);
|
||||||
nameLabel.TextAlign = ContentAlignment.MiddleCenter;
|
nameLabel.Font = new Font("Microsoft YaHei", 10, FontStyle.Bold);
|
||||||
this.Controls.Add(nameLabel);
|
nameLabel.TextAlign = ContentAlignment.MiddleCenter;
|
||||||
|
this.Controls.Add(nameLabel);
|
||||||
// 下载按钮
|
|
||||||
downloadBtn = new Button();
|
// 下载按钮
|
||||||
downloadBtn.Text = "下载";
|
downloadBtn = new Button();
|
||||||
downloadBtn.Size = new Size(100, 32);
|
downloadBtn.Text = "下载";
|
||||||
downloadBtn.Location = new Point((Width - 100) / 2, 150);
|
downloadBtn.Size = new Size(100, 32);
|
||||||
downloadBtn.BackColor = Color.FromArgb(0, 120, 215);
|
downloadBtn.Location = new Point((Width - 100) / 2, 150);
|
||||||
downloadBtn.ForeColor = Color.White;
|
downloadBtn.BackColor = Color.FromArgb(0, 120, 215);
|
||||||
downloadBtn.FlatStyle = FlatStyle.Flat;
|
downloadBtn.ForeColor = Color.White;
|
||||||
downloadBtn.FlatAppearance.BorderSize = 0;
|
downloadBtn.FlatStyle = FlatStyle.Flat;
|
||||||
downloadBtn.Cursor = Cursors.Hand;
|
downloadBtn.FlatAppearance.BorderSize = 0;
|
||||||
downloadBtn.Font = new Font("Microsoft YaHei", 9);
|
downloadBtn.Cursor = Cursors.Hand;
|
||||||
|
downloadBtn.Font = new Font("Microsoft YaHei", 9);
|
||||||
// 按钮悬停效果
|
|
||||||
downloadBtn.MouseEnter += (s, e) => {
|
// 按钮悬停效果
|
||||||
downloadBtn.BackColor = Color.FromArgb(0, 150, 255);
|
downloadBtn.MouseEnter += (s, e) => {
|
||||||
};
|
downloadBtn.BackColor = Color.FromArgb(0, 150, 255);
|
||||||
|
};
|
||||||
downloadBtn.MouseLeave += (s, e) => {
|
|
||||||
downloadBtn.BackColor = Color.FromArgb(0, 120, 215);
|
downloadBtn.MouseLeave += (s, e) => {
|
||||||
};
|
downloadBtn.BackColor = Color.FromArgb(0, 120, 215);
|
||||||
|
};
|
||||||
downloadBtn.Click += DownloadBtn_Click;
|
|
||||||
this.Controls.Add(downloadBtn);
|
downloadBtn.Click += DownloadBtn_Click;
|
||||||
}
|
this.Controls.Add(downloadBtn);
|
||||||
|
downloadBtn.Visible = ShowDownloadButton;
|
||||||
/// <summary>
|
}
|
||||||
/// 初始化卡片边框路径
|
|
||||||
/// 使用C++程序计算高性能边框路径并缓存结果
|
/// <summary>
|
||||||
/// </summary>
|
/// 初始化卡片边框路径
|
||||||
private void InitializeBorder()
|
/// 使用C++程序计算高性能边框路径并缓存结果
|
||||||
{
|
/// </summary>
|
||||||
// 使用卡片尺寸作为缓存键
|
private void InitializeBorder()
|
||||||
string cacheKey = $"{Width}_{Height}_10";
|
{
|
||||||
|
// 使用卡片尺寸作为缓存键
|
||||||
// 检查缓存中是否已有路径
|
string cacheKey = $"{Width}_{Height}_10";
|
||||||
if (!BorderCache.TryGetValue(cacheKey, out var borderPath))
|
|
||||||
{
|
// 检查缓存中是否已有路径
|
||||||
// 创建临时文件存储路径数据
|
if (!BorderCache.TryGetValue(cacheKey, out var borderPath))
|
||||||
string tempFile = Path.GetTempFileName();
|
{
|
||||||
try
|
// 创建临时文件存储路径数据
|
||||||
{
|
string tempFile = Path.GetTempFileName();
|
||||||
// 配置C++程序启动参数
|
try
|
||||||
ProcessStartInfo startInfo = new ProcessStartInfo
|
{
|
||||||
{
|
// 配置C++程序启动参数
|
||||||
FileName = Path.Combine(Application.StartupPath, "resource", "border_renderer.exe"),
|
ProcessStartInfo startInfo = new ProcessStartInfo
|
||||||
Arguments = $"{Width} {Height} 10 \"{tempFile}\"", // 传递宽高和圆角半径
|
{
|
||||||
UseShellExecute = false, // 不显示命令行窗口
|
FileName = Path.Combine(Application.StartupPath, "resource", "border_renderer.exe"),
|
||||||
CreateNoWindow = true // 静默运行
|
Arguments = $"{Width} {Height} 10 \"{tempFile}\"", // 传递宽高和圆角半径
|
||||||
};
|
UseShellExecute = false, // 不显示命令行窗口
|
||||||
|
CreateNoWindow = true // 静默运行
|
||||||
// 启动C++程序计算路径
|
};
|
||||||
using (var process = Process.Start(startInfo))
|
|
||||||
{
|
// 启动C++程序计算路径
|
||||||
process.WaitForExit();
|
using (var process = Process.Start(startInfo))
|
||||||
|
{
|
||||||
// 检查计算结果
|
process.WaitForExit();
|
||||||
if (process.ExitCode == 0 && File.Exists(tempFile))
|
|
||||||
{
|
// 检查计算结果
|
||||||
// 读取C++程序生成的路径点
|
if (process.ExitCode == 0 && File.Exists(tempFile))
|
||||||
var lines = File.ReadAllLines(tempFile);
|
{
|
||||||
PointF[] points = lines.Select(line => {
|
// 读取C++程序生成的路径点
|
||||||
var parts = line.Split(','); // 解析坐标点
|
var lines = File.ReadAllLines(tempFile);
|
||||||
return new PointF(float.Parse(parts[0]), float.Parse(parts[1]));
|
PointF[] points = lines.Select(line => {
|
||||||
}).ToArray();
|
var parts = line.Split(','); // 解析坐标点
|
||||||
|
return new PointF(float.Parse(parts[0]), float.Parse(parts[1]));
|
||||||
// 创建GraphicsPath对象
|
}).ToArray();
|
||||||
borderPath = new System.Drawing.Drawing2D.GraphicsPath();
|
|
||||||
borderPath.AddLines(points); // 添加路径点
|
// 创建GraphicsPath对象
|
||||||
|
borderPath = new System.Drawing.Drawing2D.GraphicsPath();
|
||||||
// 缓存路径对象
|
borderPath.AddLines(points); // 添加路径点
|
||||||
BorderCache.TryAdd(cacheKey, borderPath);
|
|
||||||
}
|
// 缓存路径对象
|
||||||
}
|
BorderCache.TryAdd(cacheKey, borderPath);
|
||||||
}
|
}
|
||||||
finally
|
}
|
||||||
{
|
}
|
||||||
// 确保临时文件被删除
|
finally
|
||||||
if (File.Exists(tempFile))
|
{
|
||||||
{
|
// 确保临时文件被删除
|
||||||
File.Delete(tempFile);
|
if (File.Exists(tempFile))
|
||||||
}
|
{
|
||||||
}
|
File.Delete(tempFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 边框和阴影效果
|
}
|
||||||
protected override void OnPaint(PaintEventArgs e)
|
|
||||||
{
|
// 边框和阴影效果
|
||||||
base.OnPaint(e);
|
protected override void OnPaint(PaintEventArgs e)
|
||||||
|
{
|
||||||
// 绘制背景
|
base.OnPaint(e);
|
||||||
using (var brush = new SolidBrush(this.BackColor)) {
|
|
||||||
e.Graphics.FillRectangle(brush, this.ClientRectangle);
|
// 绘制背景
|
||||||
}
|
using (var brush = new SolidBrush(this.BackColor)) {
|
||||||
|
e.Graphics.FillRectangle(brush, this.ClientRectangle);
|
||||||
string cacheKey = $"{Width}_{Height}_10";
|
}
|
||||||
if (BorderCache.TryGetValue(cacheKey, out var borderPath))
|
|
||||||
{
|
string cacheKey = $"{Width}_{Height}_10";
|
||||||
try
|
if (BorderCache.TryGetValue(cacheKey, out var borderPath))
|
||||||
{
|
{
|
||||||
// 绘制阴影
|
try
|
||||||
using (var shadowBrush = new SolidBrush(Color.FromArgb(20, 0, 0, 0))) {
|
{
|
||||||
e.Graphics.FillPath(shadowBrush, borderPath);
|
// 绘制阴影
|
||||||
}
|
using (var shadowBrush = new SolidBrush(Color.FromArgb(20, 0, 0, 0))) {
|
||||||
|
e.Graphics.FillPath(shadowBrush, borderPath);
|
||||||
// 绘制边框(调整为蓝色系)
|
}
|
||||||
using (var pen = new Pen(Color.FromArgb(70, 130, 200), 4)) {
|
|
||||||
e.Graphics.DrawPath(pen, borderPath);
|
// 绘制边框(调整为蓝色系)
|
||||||
}
|
using (var pen = new Pen(Color.FromArgb(70, 130, 200), 4)) {
|
||||||
}
|
e.Graphics.DrawPath(pen, borderPath);
|
||||||
catch (Exception ex)
|
}
|
||||||
{
|
}
|
||||||
Debug.WriteLine($"边框绘制错误: {ex.Message}");
|
catch (Exception ex)
|
||||||
// 回退到简单矩形边框
|
{
|
||||||
using (var pen = new Pen(Color.FromArgb(100, 150, 220), 2)) {
|
Debug.WriteLine($"边框绘制错误: {ex.Message}");
|
||||||
e.Graphics.DrawRectangle(pen, new Rectangle(0, 0, Width-1, Height-1));
|
// 回退到简单矩形边框
|
||||||
}
|
using (var pen = new Pen(Color.FromArgb(100, 150, 220), 2)) {
|
||||||
}
|
e.Graphics.DrawRectangle(pen, new Rectangle(0, 0, Width-1, Height-1));
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
}
|
||||||
// 缓存未命中时绘制默认边框
|
else
|
||||||
using (var pen = new Pen(Color.FromArgb(100, 150, 220), 2)) {
|
{
|
||||||
e.Graphics.DrawRectangle(pen, new Rectangle(0, 0, Width-1, Height-1));
|
// 缓存未命中时绘制默认边框
|
||||||
}
|
using (var pen = new Pen(Color.FromArgb(100, 150, 220), 2)) {
|
||||||
}
|
e.Graphics.DrawRectangle(pen, new Rectangle(0, 0, Width-1, Height-1));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/// <summary>
|
}
|
||||||
/// 初始化卡片形状路径
|
|
||||||
/// 使用C++程序计算圆角矩形路径并缓存结果
|
/// <summary>
|
||||||
/// </summary>
|
/// 初始化卡片形状路径
|
||||||
private void InitializeCardPath()
|
/// 使用C++程序计算圆角矩形路径并缓存结果
|
||||||
{
|
/// </summary>
|
||||||
int radius = 10; // 圆角半径
|
private void InitializeCardPath()
|
||||||
string cacheKey = $"{Width}_{Height}_{radius}"; // 缓存键
|
{
|
||||||
|
int radius = 10; // 圆角半径
|
||||||
// 检查缓存
|
string cacheKey = $"{Width}_{Height}_{radius}"; // 缓存键
|
||||||
if (!PathCache.TryGetValue(cacheKey, out var path))
|
|
||||||
{
|
// 检查缓存
|
||||||
string tempFile = Path.GetTempFileName(); // 临时文件路径
|
if (!PathCache.TryGetValue(cacheKey, out var path))
|
||||||
|
{
|
||||||
try {
|
string tempFile = Path.GetTempFileName(); // 临时文件路径
|
||||||
// 配置C++程序启动参数
|
|
||||||
ProcessStartInfo startInfo = new ProcessStartInfo {
|
try {
|
||||||
FileName = Path.Combine(Application.StartupPath, "resource", "card_calculator.exe"),
|
// 配置C++程序启动参数
|
||||||
Arguments = $"{Width} {Height} {radius} {tempFile}", // 传递宽高半径和输出文件
|
ProcessStartInfo startInfo = new ProcessStartInfo {
|
||||||
UseShellExecute = false, // 不显示命令行窗口
|
FileName = Path.Combine(Application.StartupPath, "resource", "card_calculator.exe"),
|
||||||
CreateNoWindow = true // 静默运行
|
Arguments = $"{Width} {Height} {radius} {tempFile}", // 传递宽高半径和输出文件
|
||||||
};
|
UseShellExecute = false, // 不显示命令行窗口
|
||||||
|
CreateNoWindow = true // 静默运行
|
||||||
// 启动C++程序计算路径
|
};
|
||||||
using (var process = Process.Start(startInfo)) {
|
|
||||||
process.WaitForExit();
|
// 启动C++程序计算路径
|
||||||
|
using (var process = Process.Start(startInfo)) {
|
||||||
// 检查计算结果
|
process.WaitForExit();
|
||||||
if (process.ExitCode == 0 && File.Exists(tempFile)) {
|
|
||||||
// 读取生成的路径点
|
// 检查计算结果
|
||||||
var lines = File.ReadAllLines(tempFile);
|
if (process.ExitCode == 0 && File.Exists(tempFile)) {
|
||||||
PointF[] points = lines.Select(line => {
|
// 读取生成的路径点
|
||||||
var parts = line.Split(','); // 解析坐标
|
var lines = File.ReadAllLines(tempFile);
|
||||||
return new PointF(float.Parse(parts[0]), float.Parse(parts[1]));
|
PointF[] points = lines.Select(line => {
|
||||||
}).ToArray();
|
var parts = line.Split(','); // 解析坐标
|
||||||
|
return new PointF(float.Parse(parts[0]), float.Parse(parts[1]));
|
||||||
// 创建并缓存路径对象
|
}).ToArray();
|
||||||
path = new System.Drawing.Drawing2D.GraphicsPath();
|
|
||||||
path.AddLines(points);
|
// 创建并缓存路径对象
|
||||||
PathCache.TryAdd(cacheKey, path);
|
path = new System.Drawing.Drawing2D.GraphicsPath();
|
||||||
}
|
path.AddLines(points);
|
||||||
}
|
PathCache.TryAdd(cacheKey, path);
|
||||||
} catch {
|
}
|
||||||
// C++程序失败时使用C#回退方案
|
}
|
||||||
path = CalculatePathFallback(Width, Height, radius);
|
} catch {
|
||||||
} finally {
|
// C++程序失败时使用C#回退方案
|
||||||
// 确保删除临时文件
|
path = CalculatePathFallback(Width, Height, radius);
|
||||||
if (File.Exists(tempFile)) {
|
} finally {
|
||||||
File.Delete(tempFile);
|
// 确保删除临时文件
|
||||||
}
|
if (File.Exists(tempFile)) {
|
||||||
}
|
File.Delete(tempFile);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 应用计算好的路径 - 更严格的null检查和异常处理
|
}
|
||||||
try
|
|
||||||
{
|
// 应用计算好的路径 - 更严格的null检查和异常处理
|
||||||
var safePath = path ?? CalculatePathFallback(Width, Height, 10);
|
try
|
||||||
// 更严格的null检查,包括路径和控件状态
|
{
|
||||||
if (safePath != null &&
|
var safePath = path ?? CalculatePathFallback(Width, Height, 10);
|
||||||
safePath.PointCount > 0 &&
|
// 更严格的null检查,包括路径和控件状态
|
||||||
this.IsHandleCreated &&
|
if (safePath != null &&
|
||||||
!this.IsDisposed)
|
safePath.PointCount > 0 &&
|
||||||
{
|
this.IsHandleCreated &&
|
||||||
this.Invoke((MethodInvoker)delegate {
|
!this.IsDisposed)
|
||||||
try
|
{
|
||||||
{
|
this.Invoke((MethodInvoker)delegate {
|
||||||
// 委托内部再次验证safePath
|
try
|
||||||
if (safePath != null && safePath.PointCount > 0)
|
{
|
||||||
{
|
// 委托内部再次验证safePath
|
||||||
var validPath = safePath; // 确保非null
|
if (safePath != null && safePath.PointCount > 0)
|
||||||
using (var region = new Region(validPath))
|
{
|
||||||
{
|
var validPath = safePath; // 确保非null
|
||||||
this.Region = region;
|
using (var region = new Region(validPath))
|
||||||
this.Refresh();
|
{
|
||||||
}
|
this.Region = region;
|
||||||
}
|
this.Refresh();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
}
|
||||||
{
|
}
|
||||||
Debug.WriteLine($"创建Region失败: {ex.Message}");
|
catch (Exception ex)
|
||||||
this.Region = null;
|
{
|
||||||
this.Refresh();
|
Debug.WriteLine($"创建Region失败: {ex.Message}");
|
||||||
}
|
this.Region = null;
|
||||||
});
|
this.Refresh();
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
catch (Exception ex)
|
}
|
||||||
{
|
}
|
||||||
Debug.WriteLine($"初始化卡片路径失败: {ex.Message}");
|
catch (Exception ex)
|
||||||
}
|
{
|
||||||
}
|
Debug.WriteLine($"初始化卡片路径失败: {ex.Message}");
|
||||||
|
}
|
||||||
private System.Drawing.Drawing2D.GraphicsPath CalculatePathFallback(int width, int height, int radius)
|
}
|
||||||
{
|
|
||||||
try
|
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();
|
||||||
catch
|
return path;
|
||||||
{
|
}
|
||||||
// 绝对回退方案 - 返回最小有效路径
|
catch
|
||||||
var path = new System.Drawing.Drawing2D.GraphicsPath();
|
{
|
||||||
path.AddRectangle(new Rectangle(0, 0, width, height));
|
// 绝对回退方案 - 返回最小有效路径
|
||||||
return path;
|
var path = new System.Drawing.Drawing2D.GraphicsPath();
|
||||||
}
|
path.AddRectangle(new Rectangle(0, 0, width, height));
|
||||||
}
|
return path;
|
||||||
|
}
|
||||||
public void UpdateDisplay()
|
}
|
||||||
{
|
|
||||||
nameLabel.Text = AppName;
|
public void UpdateDisplay()
|
||||||
iconBox.Image = AppIcon;
|
{
|
||||||
}
|
nameLabel.Text = AppName;
|
||||||
|
iconBox.Image = AppIcon;
|
||||||
private void DownloadBtn_Click(object sender, EventArgs e)
|
}
|
||||||
{
|
|
||||||
try
|
private void DownloadBtn_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
// 更严格的null检查
|
try
|
||||||
// 更严格的null检查,包括DownloadManager.Instance和其方法
|
{
|
||||||
// 全面的null和状态检查
|
// 更严格的null检查
|
||||||
if (sender == null || e == null ||
|
// 更严格的null检查,包括DownloadManager.Instance和其方法
|
||||||
string.IsNullOrWhiteSpace(DownloadUrl) ||
|
// 全面的null和状态检查
|
||||||
string.IsNullOrWhiteSpace(AppName) ||
|
if (sender == null || e == null ||
|
||||||
!this.IsHandleCreated ||
|
string.IsNullOrWhiteSpace(DownloadUrl) ||
|
||||||
this.IsDisposed ||
|
string.IsNullOrWhiteSpace(AppName) ||
|
||||||
DownloadManager.Instance == null ||
|
!this.IsHandleCreated ||
|
||||||
DownloadManager.Instance.DownloadItems == null ||
|
this.IsDisposed ||
|
||||||
DownloadManager.Instance.StartDownload == null)
|
DownloadManager.Instance == null ||
|
||||||
{
|
DownloadManager.Instance.DownloadItems == null ||
|
||||||
return;
|
DownloadManager.Instance.StartDownload == null)
|
||||||
}
|
{
|
||||||
|
return;
|
||||||
string safeAppName = AppName ?? "未知应用";
|
}
|
||||||
string fileName = $"{safeAppName.Replace(" ", "_")}.exe";
|
|
||||||
|
string safeAppName = AppName ?? "未知应用";
|
||||||
DownloadManager.Instance.StartDownload(fileName, DownloadUrl);
|
string fileName = $"{safeAppName.Replace(" ", "_")}.exe";
|
||||||
|
|
||||||
string message = $"已开始下载: {safeAppName}";
|
DownloadManager.Instance.StartDownload(fileName, DownloadUrl);
|
||||||
this.Invoke((MethodInvoker)delegate {
|
|
||||||
MessageBox.Show(this, message, "下载中", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
string message = $"已开始下载: {safeAppName}";
|
||||||
});
|
this.Invoke((MethodInvoker)delegate {
|
||||||
}
|
MessageBox.Show(this, message, "下载中", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
catch (Exception ex)
|
});
|
||||||
{
|
}
|
||||||
Debug.WriteLine($"下载按钮点击处理失败: {ex.Message}");
|
catch (Exception ex)
|
||||||
this.Invoke((MethodInvoker)delegate {
|
{
|
||||||
MessageBox.Show(this, "下载处理发生错误", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
Debug.WriteLine($"下载按钮点击处理失败: {ex.Message}");
|
||||||
});
|
this.Invoke((MethodInvoker)delegate {
|
||||||
}
|
MessageBox.Show(this, "下载处理发生错误", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,33 +1,36 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<NoWarn>CS8622</NoWarn>
|
<NoWarn>CS8622</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFramework>net8.0-windows</TargetFramework>
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<WarningsAsErrors>CS8618</WarningsAsErrors>
|
<WarningsAsErrors>CS8618</WarningsAsErrors>
|
||||||
<ApplicationIcon>img\ico\icon.ico</ApplicationIcon>
|
<ApplicationIcon>img\ico\icon.ico</ApplicationIcon>
|
||||||
<Platforms>x86;x64</Platforms>
|
<Platforms>x86;x64</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="help.txt" />
|
<None Include="help.txt" />
|
||||||
<None Include="resource\*.exe">
|
<None Include="resource\*.exe">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="img\png\*.png">
|
<None Include="img\png\*.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="img\jpg\*.jpg">
|
<None Include="img\jpg\*.jpg">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="img\ico\icon.ico">
|
<None Include="img\resource\png\*.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
<None Include="img\ico\*.ico">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Project>
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|||||||
12
CONTRIBUTING.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# 贡献准则
|
||||||
|
|
||||||
|
你可以进行任何(确保安全的前提下)的修改
|
||||||
|
我会对贡献进行审核,速度很快的
|
||||||
|
我会定时查看PR
|
||||||
|
你可以通过Fork到自己的仓库
|
||||||
|
然后上传软件图标,修改代码
|
||||||
|
然后提PR
|
||||||
|
你就可以做出贡献了
|
||||||
|
当然你也可以进行其他形式的修改
|
||||||
|
|
||||||
|
Remeber it!整个世界都在为你而闪耀
|
||||||
2104
MainForm.cs
28
README.md
@@ -16,13 +16,8 @@
|
|||||||
|
|
||||||
## 项目简介
|
## 项目简介
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
这个图片可能有点问题,因为它是gitee仓库中的图片
|
|
||||||
这是为了加快图片渲染速度,但是它好像只能渲染一半,在gitee是正常的
|
|
||||||
这个我没什么办法了
|
|
||||||
|
|
||||||
一个简单的Windows应用商店应用,提供软件下载和管理功能。
|
一个简单的Windows应用商店应用,提供软件下载和管理功能。
|
||||||
|
提供软件管理、下载管理、内置工具使用等功能
|
||||||
|
|
||||||
## 功能特点
|
## 功能特点
|
||||||
|
|
||||||
@@ -30,6 +25,7 @@
|
|||||||
- 下载进度管理
|
- 下载进度管理
|
||||||
- 支持后台下载
|
- 支持后台下载
|
||||||
- 美观的应用卡片展示
|
- 美观的应用卡片展示
|
||||||
|
- 功能化、结构化的代码处理
|
||||||
|
|
||||||
## 构建与打包
|
## 构建与打包
|
||||||
|
|
||||||
@@ -61,7 +57,7 @@ bin\Release\net8.0-windows\[platform]\publish
|
|||||||
## 项目结构
|
## 项目结构
|
||||||
|
|
||||||
```
|
```
|
||||||
AppStore/
|
kortapp-z/
|
||||||
├── MainForm.cs # 主窗体逻辑
|
├── MainForm.cs # 主窗体逻辑
|
||||||
├── DownloadManager.cs # 下载管理
|
├── DownloadManager.cs # 下载管理
|
||||||
├── AppCard.cs # 应用卡片控件
|
├── AppCard.cs # 应用卡片控件
|
||||||
@@ -82,16 +78,30 @@ AppStore/
|
|||||||
|
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2025 kortapp-z项目组
|
Copyright (c) 2025 zsyg
|
||||||
|
|
||||||
## 其他网站
|
## 其他网站
|
||||||
|
|
||||||
gitee镜像仓库:https://gitee.com/chr_super/kortapp-z
|
gitee镜像仓库:https://gitee.com/chr_super/kortapp-z(目前已经停止维护)
|
||||||
|
|
||||||
## 维护
|
## 维护
|
||||||
|
|
||||||
|
由于gitee我没怎么用,而且操作麻烦,gitee镜像将不会继续同步,有懂得人可以帮我搞下镜像吗,qq: 3872006562,也可以b站直接私信,我会在readme中鸣谢的,谢谢各位
|
||||||
|
|
||||||
|
提示:由于github上传文件的限制,img/png/NET.png,请改名为.NET.png,否则程序可能出现无法预料的问题
|
||||||
|
|
||||||
每一个人都可以通过PR添加属于自己的合法软件
|
每一个人都可以通过PR添加属于自己的合法软件
|
||||||
|
|
||||||
|
作者邮箱:
|
||||||
|
```
|
||||||
|
3872006562@qq.com
|
||||||
|
```
|
||||||
|
|
||||||
|
作者qq号:
|
||||||
|
```
|
||||||
|
3872006562
|
||||||
|
```
|
||||||
|
|
||||||
qq群:
|
qq群:
|
||||||
```
|
```
|
||||||
1043867176
|
1043867176
|
||||||
|
|||||||
7
SECURITY.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# 安全准则
|
||||||
|
|
||||||
|
# 安全提醒
|
||||||
|
|
||||||
|
应用商店的软件我们无法保证绝对性的安全
|
||||||
|
在下载和使用、安装之前请为该软件做足充足的功课
|
||||||
|
如果出现系统无法打开,我们无法负责,只能悲哀
|
||||||
77
ToolCard.cs
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace AppStore
|
||||||
|
{
|
||||||
|
public class ToolCard : UserControl
|
||||||
|
{
|
||||||
|
private PictureBox iconBox = new PictureBox();
|
||||||
|
private Label nameLabel = new Label();
|
||||||
|
|
||||||
|
public string ToolName { get; set; } = string.Empty;
|
||||||
|
public Image ToolIcon { get; set; } = SystemIcons.Shield.ToBitmap();
|
||||||
|
|
||||||
|
// 自定义点击事件初始化为空委托
|
||||||
|
public event EventHandler ToolCardClicked = delegate {};
|
||||||
|
|
||||||
|
public ToolCard()
|
||||||
|
{
|
||||||
|
// 启用双缓冲
|
||||||
|
this.SetStyle(ControlStyles.OptimizedDoubleBuffer |
|
||||||
|
ControlStyles.ResizeRedraw, true);
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.Size = new Size(240, 220);
|
||||||
|
this.BackColor = Color.White;
|
||||||
|
this.Padding = new Padding(5);
|
||||||
|
this.BorderStyle = BorderStyle.FixedSingle;
|
||||||
|
|
||||||
|
// 工具图标
|
||||||
|
iconBox = new PictureBox();
|
||||||
|
iconBox.Size = new Size(80, 80);
|
||||||
|
iconBox.Location = new Point((Width - 80) / 2, 15);
|
||||||
|
iconBox.SizeMode = PictureBoxSizeMode.StretchImage;
|
||||||
|
this.Controls.Add(iconBox);
|
||||||
|
|
||||||
|
// 工具名称
|
||||||
|
nameLabel = new Label();
|
||||||
|
nameLabel.AutoSize = false;
|
||||||
|
nameLabel.Size = new Size(Width - 20, 30);
|
||||||
|
nameLabel.Location = new Point(10, 100);
|
||||||
|
nameLabel.Font = new Font("Microsoft YaHei", 10, FontStyle.Bold);
|
||||||
|
nameLabel.TextAlign = ContentAlignment.MiddleCenter;
|
||||||
|
this.Controls.Add(nameLabel);
|
||||||
|
|
||||||
|
// 打开按钮
|
||||||
|
var openButton = new Button();
|
||||||
|
openButton.Text = "打开工具";
|
||||||
|
openButton.Size = new Size(100, 30);
|
||||||
|
openButton.Location = new Point((Width - 100) / 2, 140);
|
||||||
|
openButton.BackColor = Color.FromArgb(0, 120, 215);
|
||||||
|
openButton.ForeColor = Color.White;
|
||||||
|
openButton.FlatStyle = FlatStyle.Flat;
|
||||||
|
openButton.FlatAppearance.BorderSize = 0;
|
||||||
|
openButton.Cursor = Cursors.Hand;
|
||||||
|
// 按钮点击直接触发ToolCardClicked事件
|
||||||
|
openButton.Click += (s, e) => {
|
||||||
|
ToolCardClicked?.Invoke(this, e);
|
||||||
|
};
|
||||||
|
this.Controls.Add(openButton);
|
||||||
|
|
||||||
|
// 设置按钮悬停效果
|
||||||
|
openButton.BackColor = Color.FromArgb(0, 120, 215);
|
||||||
|
openButton.FlatAppearance.MouseOverBackColor = Color.FromArgb(0, 100, 180);
|
||||||
|
openButton.FlatAppearance.MouseDownBackColor = Color.FromArgb(0, 80, 160);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateDisplay()
|
||||||
|
{
|
||||||
|
nameLabel.Text = ToolName;
|
||||||
|
iconBox.Image = ToolIcon;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
49
docs/about.html
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>关于kortapp-z</title>
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<h1>关于kortapp-z</h1>
|
||||||
|
<p>了解我们的项目和团队</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main>
|
||||||
|
<section class="about-project">
|
||||||
|
<h2>项目简介</h2>
|
||||||
|
<p>kortapp-z是一个专为Windows系统设计的实用工具集合,旨在提供一站式的系统优化和管理解决方案。</p>
|
||||||
|
<p>项目始于2025年,由热爱效率工具的开发者创建。</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="team">
|
||||||
|
<h2>开发团队</h2>
|
||||||
|
<p>我们的团队由经验丰富的开发人员组成,专注于创建高质量的系统工具。</p>
|
||||||
|
<ul>
|
||||||
|
<li>核心开发者: 1人</li>
|
||||||
|
<li>UI设计师: 1人</li>
|
||||||
|
<li>测试工程师: 1人</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="contact">
|
||||||
|
<h2>联系我们</h2>
|
||||||
|
<p>如有任何问题或建议,欢迎通过GitHub提交issue或pull request。</p>
|
||||||
|
<a href="https://github.com/zs-yg/kortapp-z/issues" target="_blank">提交反馈</a>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<nav>
|
||||||
|
<a href="index.html">首页</a>
|
||||||
|
<a href="features.html">功能</a>
|
||||||
|
</nav>
|
||||||
|
<p>© 2025 kortapp-z 团队</p>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<script src="script.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
49
docs/features.html
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>kortapp-z功能详情</title>
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<h1>kortapp-z功能详情</h1>
|
||||||
|
<p>探索我们强大的工具集</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main>
|
||||||
|
<section class="feature-list">
|
||||||
|
<h2>核心功能</h2>
|
||||||
|
|
||||||
|
<article class="feature">
|
||||||
|
<h3>应用程序管理</h3>
|
||||||
|
<p>批量安装、卸载(目前没有)和更新应用程序(目前没有),管理启动项(目前没有)。</p>
|
||||||
|
<p>优势:集中管理所有应用,节省时间,避免系统臃肿。</p>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<article class="feature">
|
||||||
|
<h3>资源监控(之后可能在内置工具里有)</h3>
|
||||||
|
<p>实时监控CPU、内存、磁盘和网络使用情况。</p>
|
||||||
|
<p>优势:直观的图表展示,及时发现资源瓶颈。</p>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<article class="feature">
|
||||||
|
<h3>文件管理(之后可能在内置工具里有)</h3>
|
||||||
|
<p>高级文件搜索、批量重命名和快速文件分类。</p>
|
||||||
|
<p>优势:提升文件管理效率,支持正则表达式搜索。</p>
|
||||||
|
</article>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<nav>
|
||||||
|
<a href="index.html">首页</a>
|
||||||
|
<a href="about.html">关于</a>
|
||||||
|
</nav>
|
||||||
|
<p>© 2025 kortapp-z 团队</p>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<script src="script.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
42
docs/index.html
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>kortapp-z - Windows实用工具</title>
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<h1>欢迎使用kortapp-z</h1>
|
||||||
|
<p>您的一站式Windows实用工具</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main>
|
||||||
|
<section class="features">
|
||||||
|
<h2>主要功能</h2>
|
||||||
|
<ul>
|
||||||
|
<li>内置工具</li>
|
||||||
|
<li>应用程序下载</li>
|
||||||
|
<li>更多实用功能</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="github">
|
||||||
|
<h2>项目GitHub地址</h2>
|
||||||
|
<p>查看源代码并参与贡献:</p>
|
||||||
|
<a href="https://github.com/zs-yg/kortapp-z" target="_blank">GitHub仓库</a>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<nav>
|
||||||
|
<a href="about.html">关于</a>
|
||||||
|
<a href="features.html">功能</a>
|
||||||
|
</nav>
|
||||||
|
<p>© 2025 zsyg</p>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<script src="script.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
31
docs/script.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
// 页面加载完成后执行
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
// 获取当前年份并更新页脚版权信息
|
||||||
|
const yearElement = document.querySelector('footer p');
|
||||||
|
if (yearElement) {
|
||||||
|
const currentYear = new Date().getFullYear();
|
||||||
|
yearElement.textContent = yearElement.textContent.replace('2025', currentYear);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 为所有导航链接添加点击效果
|
||||||
|
const navLinks = document.querySelectorAll('nav a');
|
||||||
|
navLinks.forEach(link => {
|
||||||
|
link.addEventListener('click', function(e) {
|
||||||
|
// 可以在这里添加页面切换动画或其他效果
|
||||||
|
console.log('导航到: ' + this.getAttribute('href'));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 功能列表项悬停效果
|
||||||
|
const featureItems = document.querySelectorAll('.features li');
|
||||||
|
featureItems.forEach(item => {
|
||||||
|
item.addEventListener('mouseover', function() {
|
||||||
|
this.style.transform = 'translateX(5px)';
|
||||||
|
this.style.transition = 'transform 0.3s ease';
|
||||||
|
});
|
||||||
|
|
||||||
|
item.addEventListener('mouseout', function() {
|
||||||
|
this.style.transform = '';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
71
docs/style.css
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
/* 全局样式 */
|
||||||
|
body {
|
||||||
|
font-family: 'Microsoft YaHei', sans-serif;
|
||||||
|
line-height: 1.6;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
color: #333;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 页眉样式 */
|
||||||
|
header {
|
||||||
|
background-color: #2c3e50;
|
||||||
|
color: white;
|
||||||
|
text-align: center;
|
||||||
|
padding: 2rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
header h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 2.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
header p {
|
||||||
|
margin: 0.5rem 0 0;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 主体内容样式 */
|
||||||
|
main {
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 2rem auto;
|
||||||
|
padding: 0 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
section {
|
||||||
|
background: white;
|
||||||
|
border-radius: 5px;
|
||||||
|
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
||||||
|
padding: 2rem;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
color: #2c3e50;
|
||||||
|
border-bottom: 2px solid #eee;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 链接样式 */
|
||||||
|
a {
|
||||||
|
color: #3498db;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 页脚样式 */
|
||||||
|
footer {
|
||||||
|
text-align: center;
|
||||||
|
padding: 1rem 0;
|
||||||
|
background-color: #2c3e50;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer nav a {
|
||||||
|
color: white;
|
||||||
|
margin: 0 1rem;
|
||||||
|
}
|
||||||
BIN
img/jpg/Twinkstar.jpg
Normal file
|
After Width: | Height: | Size: 256 KiB |
BIN
img/jpg/pcl2.jpg
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
img/png/DWMBlurGlass.png
Normal file
|
After Width: | Height: | Size: 475 B |
BIN
img/png/NET.png
Normal file
|
After Width: | Height: | Size: 796 B |
BIN
img/png/Umi-OCR.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
img/resource/png/QRcode.png
Normal file
|
After Width: | Height: | Size: 989 KiB |
BIN
img/resource/png/system_cleaner.png
Normal file
|
After Width: | Height: | Size: 644 KiB |
BIN
resource/system_cleaner.exe
Normal file
134
tools/QrCodeGenerator.cs
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using ZXing;
|
||||||
|
using ZXing.Common;
|
||||||
|
using ZXing.QrCode;
|
||||||
|
|
||||||
|
namespace AppStore
|
||||||
|
{
|
||||||
|
public class QrCodeGeneratorForm : Form
|
||||||
|
{
|
||||||
|
private TextBox? inputTextBox;
|
||||||
|
private PictureBox? qrCodePictureBox;
|
||||||
|
private Button? generateButton;
|
||||||
|
private Button? saveButton;
|
||||||
|
|
||||||
|
public QrCodeGeneratorForm()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.Text = "二维码生成器";
|
||||||
|
this.Size = new Size(500, 600);
|
||||||
|
this.StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
// 输入文本框
|
||||||
|
inputTextBox = new TextBox();
|
||||||
|
inputTextBox.Multiline = true;
|
||||||
|
inputTextBox.ScrollBars = ScrollBars.Vertical;
|
||||||
|
inputTextBox.Size = new Size(400, 100);
|
||||||
|
inputTextBox.Location = new Point(50, 30);
|
||||||
|
inputTextBox.PlaceholderText = "请输入要生成二维码的文本内容...";
|
||||||
|
this.Controls.Add(inputTextBox);
|
||||||
|
|
||||||
|
// 生成按钮
|
||||||
|
generateButton = new Button();
|
||||||
|
generateButton.Text = "生成二维码";
|
||||||
|
generateButton.Size = new Size(150, 40);
|
||||||
|
generateButton.Location = new Point(50, 150);
|
||||||
|
generateButton.Click += GenerateButton_Click;
|
||||||
|
this.Controls.Add(generateButton);
|
||||||
|
|
||||||
|
// 二维码显示区域
|
||||||
|
qrCodePictureBox = new PictureBox();
|
||||||
|
qrCodePictureBox.Size = new Size(300, 300);
|
||||||
|
qrCodePictureBox.Location = new Point(100, 220);
|
||||||
|
qrCodePictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
|
||||||
|
qrCodePictureBox.BorderStyle = BorderStyle.FixedSingle;
|
||||||
|
this.Controls.Add(qrCodePictureBox);
|
||||||
|
|
||||||
|
// 保存按钮
|
||||||
|
saveButton = new Button();
|
||||||
|
saveButton.Text = "保存二维码";
|
||||||
|
saveButton.Size = new Size(150, 40);
|
||||||
|
saveButton.Location = new Point(300, 150);
|
||||||
|
saveButton.Click += SaveButton_Click;
|
||||||
|
this.Controls.Add(saveButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GenerateButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(inputTextBox?.Text))
|
||||||
|
{
|
||||||
|
MessageBox.Show("请输入要生成二维码的文本内容", "提示",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var writer = new BarcodeWriterPixelData
|
||||||
|
{
|
||||||
|
Format = BarcodeFormat.QR_CODE,
|
||||||
|
Options = new QrCodeEncodingOptions
|
||||||
|
{
|
||||||
|
Width = 300,
|
||||||
|
Height = 300,
|
||||||
|
Margin = 1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var pixelData = writer.Write(inputTextBox.Text);
|
||||||
|
var bitmap = new Bitmap(pixelData.Width, pixelData.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
|
||||||
|
var bitmapData = bitmap.LockBits(new Rectangle(0, 0, pixelData.Width, pixelData.Height),
|
||||||
|
System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan0, pixelData.Pixels.Length);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
bitmap.UnlockBits(bitmapData);
|
||||||
|
}
|
||||||
|
qrCodePictureBox!.Image = bitmap;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"生成二维码失败: {ex.Message}", "错误",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SaveButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (qrCodePictureBox?.Image == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("请先生成二维码", "提示",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
using (var saveDialog = new SaveFileDialog())
|
||||||
|
{
|
||||||
|
saveDialog.Filter = "PNG 图片|*.png|JPEG 图片|*.jpg|BMP 图片|*.bmp";
|
||||||
|
saveDialog.Title = "保存二维码图片";
|
||||||
|
if (saveDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
qrCodePictureBox!.Image.Save(saveDialog.FileName);
|
||||||
|
MessageBox.Show("二维码保存成功", "成功",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"保存二维码失败: {ex.Message}", "错误",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
96
tools/system_cleaner.cpp
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <filesystem>
|
||||||
|
#include <chrono>
|
||||||
|
#include <vector>
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
|
bool IsAdmin() {
|
||||||
|
BOOL isAdmin = FALSE;
|
||||||
|
SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
|
||||||
|
PSID AdminGroup;
|
||||||
|
|
||||||
|
if (AllocateAndInitializeSid(&NtAuthority, 2,
|
||||||
|
SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS,
|
||||||
|
0, 0, 0, 0, 0, 0, &AdminGroup)) {
|
||||||
|
if (!CheckTokenMembership(NULL, AdminGroup, &isAdmin)) {
|
||||||
|
isAdmin = FALSE;
|
||||||
|
}
|
||||||
|
FreeSid(AdminGroup);
|
||||||
|
}
|
||||||
|
return isAdmin == TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CleanDirectory(const fs::path& dir, size_t& deletedCount, size_t& errorCount) {
|
||||||
|
if (!fs::exists(dir)) {
|
||||||
|
std::cout << "目录不存在: " << dir << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto& entry : fs::directory_iterator(dir)) {
|
||||||
|
try {
|
||||||
|
if (fs::is_regular_file(entry)) {
|
||||||
|
fs::remove(entry);
|
||||||
|
deletedCount++;
|
||||||
|
}
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
std::cerr << "删除文件失败: " << entry.path() << " - " << e.what() << std::endl;
|
||||||
|
errorCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
try {
|
||||||
|
if (!IsAdmin()) {
|
||||||
|
std::cerr << "请以管理员身份运行此程序以清理所有目录" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto start = std::chrono::high_resolution_clock::now();
|
||||||
|
size_t totalDeleted = 0;
|
||||||
|
size_t totalErrors = 0;
|
||||||
|
|
||||||
|
// 定义要清理的目录列表
|
||||||
|
std::vector<fs::path> directories = {
|
||||||
|
"C:\\Windows\\Temp",
|
||||||
|
fs::path(std::getenv("USERPROFILE")) / "AppData" / "Local" / "Temp",
|
||||||
|
"C:\\Windows\\SoftwareDistribution\\Download",
|
||||||
|
"C:\\Windows\\Logs",
|
||||||
|
"C:\\Windows\\Minidump"
|
||||||
|
};
|
||||||
|
|
||||||
|
// 只有管理员才能清理Prefetch目录
|
||||||
|
if (IsAdmin()) {
|
||||||
|
directories.push_back("C:\\Windows\\Prefetch");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清理每个目录
|
||||||
|
for (const auto& dir : directories) {
|
||||||
|
size_t dirDeleted = 0;
|
||||||
|
size_t dirErrors = 0;
|
||||||
|
|
||||||
|
std::cout << "正在清理: " << dir << std::endl;
|
||||||
|
CleanDirectory(dir, dirDeleted, dirErrors);
|
||||||
|
|
||||||
|
totalDeleted += dirDeleted;
|
||||||
|
totalErrors += dirErrors;
|
||||||
|
|
||||||
|
std::cout << "已删除 " << dirDeleted << " 个文件" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto end = std::chrono::high_resolution_clock::now();
|
||||||
|
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
|
||||||
|
|
||||||
|
std::cout << "\n清理完成:" << std::endl;
|
||||||
|
std::cout << "总共删除文件数: " << totalDeleted << std::endl;
|
||||||
|
std::cout << "总共错误数: " << totalErrors << std::endl;
|
||||||
|
std::cout << "耗时: " << duration.count() << " 毫秒" << std::endl;
|
||||||
|
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
std::cerr << "发生错误: " << e.what() << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||