- 添加BookmarkExtractor类用于从FreePic2Pdf_bkmk文件提取书签内容 - 添加ContentFormatter类实现内容格式化处理 - 添加FileMerger类实现文件智能合并功能 - 更新主界面支持路径选择和处理进度显示 - 支持按文件名前缀自动合并(如CH-875 1-3和CH-875 4-6合并为CH-875.txt) - 输出格式符合需求:tableOfContents与subject之间插入格式化内容 - 支持UTF-8和GBK编码自动检测 - 添加详细的使用说明文档 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
60 lines
2.0 KiB
C#
60 lines
2.0 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
using Microsoft.Win32;
|
|
|
|
namespace SlideCombine
|
|
{
|
|
internal static class Program
|
|
{
|
|
/// <summary>
|
|
/// The main entry point for the application.
|
|
/// </summary>
|
|
[STAThread]
|
|
static void Main()
|
|
{
|
|
// 检查.NET Framework 4.8是否已安装
|
|
if (!CheckDotNetFramework48())
|
|
{
|
|
MessageBox.Show(
|
|
"检测到您的系统未安装 .NET Framework 4.8\n\n" +
|
|
"PDF书签合并工具需要此环境才能运行。\n\n" +
|
|
"请前往以下链接下载并安装:\n" +
|
|
"https://dotnet.microsoft.com/download/dotnet-framework/net48\n\n" +
|
|
"安装完成后请重新运行本程序。",
|
|
"缺少运行环境",
|
|
MessageBoxButtons.OK,
|
|
MessageBoxIcon.Error
|
|
);
|
|
return;
|
|
}
|
|
|
|
Application.EnableVisualStyles();
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
Application.Run(new Form1());
|
|
}
|
|
|
|
private static bool CheckDotNetFramework48()
|
|
{
|
|
try
|
|
{
|
|
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\"))
|
|
{
|
|
if (key != null)
|
|
{
|
|
object release = key.GetValue("Release");
|
|
if (release != null && int.TryParse(release.ToString(), out int releaseValue))
|
|
{
|
|
// .NET Framework 4.8 的 Release 值为 528040 或更高
|
|
return releaseValue >= 528040;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
// 如果无法访问注册表,假设未安装
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
} |