2025-11-24 10:59:56 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
|
|
namespace SlideCombine
|
|
|
|
|
|
{
|
|
|
|
|
|
partial class Form1
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Required designer variable.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private System.ComponentModel.IContainer components = null;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Clean up any resources being used.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
|
|
|
|
|
protected override void Dispose(bool disposing)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (disposing && (components != null))
|
|
|
|
|
|
{
|
|
|
|
|
|
components.Dispose();
|
|
|
|
|
|
}
|
|
|
|
|
|
base.Dispose(disposing);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region Windows Form Designer generated code
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Required method for Designer support - do not modify
|
|
|
|
|
|
/// the contents of this method with the code editor.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void InitializeComponent()
|
|
|
|
|
|
{
|
|
|
|
|
|
components = new System.ComponentModel.Container();
|
|
|
|
|
|
|
|
|
|
|
|
// 主窗体设置
|
|
|
|
|
|
AutoScaleMode = AutoScaleMode.Font;
|
2025-11-24 16:14:05 +08:00
|
|
|
|
ClientSize = new Size(700, 650);
|
2025-11-24 16:07:29 +08:00
|
|
|
|
Text = "PDF书签合并工具 v1.0";
|
2025-11-24 10:59:56 +08:00
|
|
|
|
StartPosition = FormStartPosition.CenterScreen;
|
2025-11-24 16:07:29 +08:00
|
|
|
|
BackColor = Color.FromArgb(240, 240, 240);
|
2025-11-24 10:59:56 +08:00
|
|
|
|
|
|
|
|
|
|
// 创建控件
|
|
|
|
|
|
grpSourceFolder = new GroupBox();
|
|
|
|
|
|
lblSourcePath = new Label();
|
|
|
|
|
|
txtSourcePath = new TextBox();
|
|
|
|
|
|
btnBrowseSource = new Button();
|
|
|
|
|
|
|
2025-11-24 16:14:05 +08:00
|
|
|
|
grpTextFolder = new GroupBox();
|
|
|
|
|
|
lblTextPath = new Label();
|
|
|
|
|
|
txtTextPath = new TextBox();
|
|
|
|
|
|
btnBrowseText = new Button();
|
|
|
|
|
|
|
2025-11-24 10:59:56 +08:00
|
|
|
|
grpOutputFolder = new GroupBox();
|
|
|
|
|
|
lblOutputPath = new Label();
|
|
|
|
|
|
txtOutputPath = new TextBox();
|
|
|
|
|
|
btnBrowseOutput = new Button();
|
|
|
|
|
|
|
|
|
|
|
|
pnlButtons = new Panel();
|
|
|
|
|
|
btnMerge = new Button();
|
|
|
|
|
|
btnClear = new Button();
|
|
|
|
|
|
btnExit = new Button();
|
|
|
|
|
|
|
|
|
|
|
|
grpProgress = new GroupBox();
|
|
|
|
|
|
progressBar = new ProgressBar();
|
2025-11-24 16:09:01 +08:00
|
|
|
|
txtLog = new RichTextBox();
|
2025-11-24 10:59:56 +08:00
|
|
|
|
|
2025-11-24 16:14:05 +08:00
|
|
|
|
// 设置PDF文件夹组
|
2025-11-24 16:07:29 +08:00
|
|
|
|
grpSourceFolder.Text = "📁 PDF文件夹路径";
|
|
|
|
|
|
grpSourceFolder.Location = new Point(15, 15);
|
2025-11-24 16:14:05 +08:00
|
|
|
|
grpSourceFolder.Size = new Size(670, 70);
|
2025-11-24 10:59:56 +08:00
|
|
|
|
grpSourceFolder.TabStop = false;
|
2025-11-24 16:07:29 +08:00
|
|
|
|
grpSourceFolder.BackColor = Color.White;
|
|
|
|
|
|
grpSourceFolder.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
2025-11-24 10:59:56 +08:00
|
|
|
|
|
2025-11-24 16:14:05 +08:00
|
|
|
|
lblSourcePath.Text = "选择包含PDF文件夹的路径(含FreePic2Pdf_bkmk.txt文件):";
|
2025-11-24 16:07:29 +08:00
|
|
|
|
lblSourcePath.Location = new Point(15, 20);
|
2025-11-24 16:14:05 +08:00
|
|
|
|
lblSourcePath.Size = new Size(350, 20);
|
2025-11-24 16:07:29 +08:00
|
|
|
|
lblSourcePath.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
2025-11-24 10:59:56 +08:00
|
|
|
|
|
2025-11-24 16:14:05 +08:00
|
|
|
|
txtSourcePath.Location = new Point(15, 40);
|
2025-11-24 16:17:11 +08:00
|
|
|
|
txtSourcePath.Size = new Size(480, 22);
|
2025-11-24 16:07:29 +08:00
|
|
|
|
txtSourcePath.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
|
|
|
|
|
txtSourcePath.BorderStyle = BorderStyle.FixedSingle;
|
2025-11-24 10:59:56 +08:00
|
|
|
|
|
|
|
|
|
|
btnBrowseSource.Text = "浏览";
|
2025-11-24 16:17:11 +08:00
|
|
|
|
btnBrowseSource.Location = new Point(500, 39);
|
|
|
|
|
|
btnBrowseSource.Size = new Size(60, 24);
|
2025-11-24 16:07:29 +08:00
|
|
|
|
btnBrowseSource.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
|
|
|
|
|
btnBrowseSource.BackColor = Color.FromArgb(66, 139, 202);
|
|
|
|
|
|
btnBrowseSource.ForeColor = Color.White;
|
|
|
|
|
|
btnBrowseSource.FlatStyle = FlatStyle.Flat;
|
|
|
|
|
|
btnBrowseSource.FlatAppearance.BorderSize = 0;
|
2025-11-24 10:59:56 +08:00
|
|
|
|
btnBrowseSource.Click += new EventHandler(btnBrowseSource_Click);
|
|
|
|
|
|
|
2025-11-24 16:17:11 +08:00
|
|
|
|
var btnPasteSource = new Button();
|
|
|
|
|
|
btnPasteSource.Text = "粘贴";
|
|
|
|
|
|
btnPasteSource.Location = new Point(565, 39);
|
|
|
|
|
|
btnPasteSource.Size = new Size(60, 24);
|
|
|
|
|
|
btnPasteSource.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
|
|
|
|
|
btnPasteSource.BackColor = Color.FromArgb(92, 184, 92);
|
|
|
|
|
|
btnPasteSource.ForeColor = Color.White;
|
|
|
|
|
|
btnPasteSource.FlatStyle = FlatStyle.Flat;
|
|
|
|
|
|
btnPasteSource.FlatAppearance.BorderSize = 0;
|
|
|
|
|
|
btnPasteSource.Click += new EventHandler(btnPasteSource_Click);
|
|
|
|
|
|
|
2025-11-24 10:59:56 +08:00
|
|
|
|
grpSourceFolder.Controls.Add(lblSourcePath);
|
|
|
|
|
|
grpSourceFolder.Controls.Add(txtSourcePath);
|
|
|
|
|
|
grpSourceFolder.Controls.Add(btnBrowseSource);
|
2025-11-24 16:17:11 +08:00
|
|
|
|
grpSourceFolder.Controls.Add(btnPasteSource);
|
2025-11-24 10:59:56 +08:00
|
|
|
|
|
2025-11-24 16:14:05 +08:00
|
|
|
|
// 设置TXT文件夹组
|
|
|
|
|
|
grpTextFolder.Text = "📄 TXT源文件路径";
|
|
|
|
|
|
grpTextFolder.Location = new Point(15, 90);
|
|
|
|
|
|
grpTextFolder.Size = new Size(670, 70);
|
|
|
|
|
|
grpTextFolder.TabStop = false;
|
|
|
|
|
|
grpTextFolder.BackColor = Color.White;
|
|
|
|
|
|
grpTextFolder.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
|
|
|
|
|
|
|
|
|
|
|
lblTextPath.Text = "选择包含元数据TXT文件的路径:";
|
|
|
|
|
|
lblTextPath.Location = new Point(15, 20);
|
|
|
|
|
|
lblTextPath.Size = new Size(350, 20);
|
|
|
|
|
|
lblTextPath.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
|
|
|
|
|
|
|
|
|
|
|
txtTextPath.Location = new Point(15, 40);
|
2025-11-24 16:17:11 +08:00
|
|
|
|
txtTextPath.Size = new Size(480, 22);
|
2025-11-24 16:14:05 +08:00
|
|
|
|
txtTextPath.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
|
|
|
|
|
txtTextPath.BorderStyle = BorderStyle.FixedSingle;
|
|
|
|
|
|
|
|
|
|
|
|
btnBrowseText.Text = "浏览";
|
2025-11-24 16:17:11 +08:00
|
|
|
|
btnBrowseText.Location = new Point(500, 39);
|
|
|
|
|
|
btnBrowseText.Size = new Size(60, 24);
|
2025-11-24 16:14:05 +08:00
|
|
|
|
btnBrowseText.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
|
|
|
|
|
btnBrowseText.BackColor = Color.FromArgb(66, 139, 202);
|
|
|
|
|
|
btnBrowseText.ForeColor = Color.White;
|
|
|
|
|
|
btnBrowseText.FlatStyle = FlatStyle.Flat;
|
|
|
|
|
|
btnBrowseText.FlatAppearance.BorderSize = 0;
|
|
|
|
|
|
btnBrowseText.Click += new EventHandler(btnBrowseText_Click);
|
|
|
|
|
|
|
2025-11-24 16:17:11 +08:00
|
|
|
|
var btnPasteText = new Button();
|
|
|
|
|
|
btnPasteText.Text = "粘贴";
|
|
|
|
|
|
btnPasteText.Location = new Point(565, 39);
|
|
|
|
|
|
btnPasteText.Size = new Size(60, 24);
|
|
|
|
|
|
btnPasteText.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
|
|
|
|
|
btnPasteText.BackColor = Color.FromArgb(92, 184, 92);
|
|
|
|
|
|
btnPasteText.ForeColor = Color.White;
|
|
|
|
|
|
btnPasteText.FlatStyle = FlatStyle.Flat;
|
|
|
|
|
|
btnPasteText.FlatAppearance.BorderSize = 0;
|
|
|
|
|
|
btnPasteText.Click += new EventHandler(btnPasteText_Click);
|
|
|
|
|
|
|
2025-11-24 16:14:05 +08:00
|
|
|
|
grpTextFolder.Controls.Add(lblTextPath);
|
|
|
|
|
|
grpTextFolder.Controls.Add(txtTextPath);
|
|
|
|
|
|
grpTextFolder.Controls.Add(btnBrowseText);
|
2025-11-24 16:17:11 +08:00
|
|
|
|
grpTextFolder.Controls.Add(btnPasteText);
|
2025-11-24 16:14:05 +08:00
|
|
|
|
|
2025-11-24 10:59:56 +08:00
|
|
|
|
// 设置输出文件夹组
|
2025-11-24 16:14:05 +08:00
|
|
|
|
grpOutputFolder.Text = "💾 最终输出路径";
|
|
|
|
|
|
grpOutputFolder.Location = new Point(15, 165);
|
|
|
|
|
|
grpOutputFolder.Size = new Size(670, 70);
|
2025-11-24 10:59:56 +08:00
|
|
|
|
grpOutputFolder.TabStop = false;
|
2025-11-24 16:07:29 +08:00
|
|
|
|
grpOutputFolder.BackColor = Color.White;
|
|
|
|
|
|
grpOutputFolder.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
2025-11-24 10:59:56 +08:00
|
|
|
|
|
2025-11-24 16:14:05 +08:00
|
|
|
|
lblOutputPath.Text = "选择合并后TXT文件的输出路径:";
|
2025-11-24 16:07:29 +08:00
|
|
|
|
lblOutputPath.Location = new Point(15, 20);
|
2025-11-24 16:14:05 +08:00
|
|
|
|
lblOutputPath.Size = new Size(350, 20);
|
2025-11-24 16:07:29 +08:00
|
|
|
|
lblOutputPath.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
2025-11-24 10:59:56 +08:00
|
|
|
|
|
2025-11-24 16:14:05 +08:00
|
|
|
|
txtOutputPath.Location = new Point(15, 40);
|
2025-11-24 16:17:11 +08:00
|
|
|
|
txtOutputPath.Size = new Size(480, 22);
|
2025-11-24 16:07:29 +08:00
|
|
|
|
txtOutputPath.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
|
|
|
|
|
txtOutputPath.BorderStyle = BorderStyle.FixedSingle;
|
2025-11-24 10:59:56 +08:00
|
|
|
|
|
|
|
|
|
|
btnBrowseOutput.Text = "浏览";
|
2025-11-24 16:17:11 +08:00
|
|
|
|
btnBrowseOutput.Location = new Point(500, 39);
|
|
|
|
|
|
btnBrowseOutput.Size = new Size(60, 24);
|
2025-11-24 16:07:29 +08:00
|
|
|
|
btnBrowseOutput.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
|
|
|
|
|
btnBrowseOutput.BackColor = Color.FromArgb(66, 139, 202);
|
|
|
|
|
|
btnBrowseOutput.ForeColor = Color.White;
|
|
|
|
|
|
btnBrowseOutput.FlatStyle = FlatStyle.Flat;
|
|
|
|
|
|
btnBrowseOutput.FlatAppearance.BorderSize = 0;
|
2025-11-24 10:59:56 +08:00
|
|
|
|
btnBrowseOutput.Click += new EventHandler(btnBrowseOutput_Click);
|
|
|
|
|
|
|
2025-11-24 16:17:11 +08:00
|
|
|
|
var btnPasteOutput = new Button();
|
|
|
|
|
|
btnPasteOutput.Text = "粘贴";
|
|
|
|
|
|
btnPasteOutput.Location = new Point(565, 39);
|
|
|
|
|
|
btnPasteOutput.Size = new Size(60, 24);
|
|
|
|
|
|
btnPasteOutput.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
|
|
|
|
|
btnPasteOutput.BackColor = Color.FromArgb(92, 184, 92);
|
|
|
|
|
|
btnPasteOutput.ForeColor = Color.White;
|
|
|
|
|
|
btnPasteOutput.FlatStyle = FlatStyle.Flat;
|
|
|
|
|
|
btnPasteOutput.FlatAppearance.BorderSize = 0;
|
|
|
|
|
|
btnPasteOutput.Click += new EventHandler(btnPasteOutput_Click);
|
|
|
|
|
|
|
2025-11-24 10:59:56 +08:00
|
|
|
|
grpOutputFolder.Controls.Add(lblOutputPath);
|
|
|
|
|
|
grpOutputFolder.Controls.Add(txtOutputPath);
|
|
|
|
|
|
grpOutputFolder.Controls.Add(btnBrowseOutput);
|
2025-11-24 16:17:11 +08:00
|
|
|
|
grpOutputFolder.Controls.Add(btnPasteOutput);
|
2025-11-24 10:59:56 +08:00
|
|
|
|
|
|
|
|
|
|
// 设置按钮面板
|
2025-11-24 16:14:05 +08:00
|
|
|
|
pnlButtons.Location = new Point(15, 240);
|
2025-11-24 16:07:29 +08:00
|
|
|
|
pnlButtons.Size = new Size(670, 50);
|
|
|
|
|
|
pnlButtons.BackColor = Color.Transparent;
|
|
|
|
|
|
|
|
|
|
|
|
btnMerge.Text = "🚀 开始合并";
|
|
|
|
|
|
btnMerge.Location = new Point(15, 10);
|
|
|
|
|
|
btnMerge.Size = new Size(120, 30);
|
|
|
|
|
|
btnMerge.Font = new Font("Microsoft YaHei", 10F, FontStyle.Bold);
|
|
|
|
|
|
btnMerge.BackColor = Color.FromArgb(92, 184, 92);
|
|
|
|
|
|
btnMerge.ForeColor = Color.White;
|
|
|
|
|
|
btnMerge.FlatStyle = FlatStyle.Flat;
|
|
|
|
|
|
btnMerge.FlatAppearance.BorderSize = 0;
|
2025-11-24 10:59:56 +08:00
|
|
|
|
btnMerge.Click += new EventHandler(btnMerge_Click);
|
|
|
|
|
|
|
2025-11-24 16:07:29 +08:00
|
|
|
|
btnClear.Text = "🔄 清空";
|
|
|
|
|
|
btnClear.Location = new Point(145, 10);
|
|
|
|
|
|
btnClear.Size = new Size(100, 30);
|
|
|
|
|
|
btnClear.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
|
|
|
|
|
btnClear.BackColor = Color.FromArgb(240, 173, 78);
|
|
|
|
|
|
btnClear.ForeColor = Color.White;
|
|
|
|
|
|
btnClear.FlatStyle = FlatStyle.Flat;
|
|
|
|
|
|
btnClear.FlatAppearance.BorderSize = 0;
|
2025-11-24 10:59:56 +08:00
|
|
|
|
btnClear.Click += new EventHandler(btnClear_Click);
|
|
|
|
|
|
|
2025-11-24 16:07:29 +08:00
|
|
|
|
btnExit.Text = "❌ 退出";
|
|
|
|
|
|
btnExit.Location = new Point(255, 10);
|
|
|
|
|
|
btnExit.Size = new Size(100, 30);
|
|
|
|
|
|
btnExit.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
|
|
|
|
|
btnExit.BackColor = Color.FromArgb(217, 83, 79);
|
|
|
|
|
|
btnExit.ForeColor = Color.White;
|
|
|
|
|
|
btnExit.FlatStyle = FlatStyle.Flat;
|
|
|
|
|
|
btnExit.FlatAppearance.BorderSize = 0;
|
2025-11-24 10:59:56 +08:00
|
|
|
|
btnExit.Click += new EventHandler(btnExit_Click);
|
|
|
|
|
|
|
|
|
|
|
|
pnlButtons.Controls.Add(btnMerge);
|
|
|
|
|
|
pnlButtons.Controls.Add(btnClear);
|
|
|
|
|
|
pnlButtons.Controls.Add(btnExit);
|
|
|
|
|
|
|
|
|
|
|
|
// 设置进度组
|
2025-11-24 16:07:29 +08:00
|
|
|
|
grpProgress.Text = "📊 处理进度";
|
2025-11-24 16:14:05 +08:00
|
|
|
|
grpProgress.Location = new Point(15, 295);
|
2025-11-24 16:07:29 +08:00
|
|
|
|
grpProgress.Size = new Size(670, 280);
|
2025-11-24 10:59:56 +08:00
|
|
|
|
grpProgress.TabStop = false;
|
2025-11-24 16:07:29 +08:00
|
|
|
|
grpProgress.BackColor = Color.White;
|
|
|
|
|
|
grpProgress.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
2025-11-24 10:59:56 +08:00
|
|
|
|
|
2025-11-24 16:07:29 +08:00
|
|
|
|
progressBar.Location = new Point(15, 25);
|
|
|
|
|
|
progressBar.Size = new Size(640, 25);
|
2025-11-24 10:59:56 +08:00
|
|
|
|
progressBar.Style = ProgressBarStyle.Continuous;
|
2025-11-24 16:07:29 +08:00
|
|
|
|
progressBar.ForeColor = Color.FromArgb(66, 139, 202);
|
2025-11-24 10:59:56 +08:00
|
|
|
|
|
2025-11-24 16:07:29 +08:00
|
|
|
|
txtLog.Location = new Point(15, 60);
|
|
|
|
|
|
txtLog.Size = new Size(640, 200);
|
2025-11-24 10:59:56 +08:00
|
|
|
|
txtLog.Multiline = true;
|
2025-11-24 16:09:01 +08:00
|
|
|
|
txtLog.ScrollBars = RichTextBoxScrollBars.Vertical;
|
2025-11-24 10:59:56 +08:00
|
|
|
|
txtLog.ReadOnly = true;
|
2025-11-24 16:07:29 +08:00
|
|
|
|
txtLog.Font = new Font("Consolas", 9F, FontStyle.Regular);
|
|
|
|
|
|
txtLog.BackColor = Color.FromArgb(248, 248, 248);
|
|
|
|
|
|
txtLog.BorderStyle = BorderStyle.FixedSingle;
|
2025-11-24 10:59:56 +08:00
|
|
|
|
|
|
|
|
|
|
grpProgress.Controls.Add(progressBar);
|
|
|
|
|
|
grpProgress.Controls.Add(txtLog);
|
|
|
|
|
|
|
|
|
|
|
|
// 添加所有控件到窗体
|
|
|
|
|
|
Controls.Add(grpSourceFolder);
|
2025-11-24 16:14:05 +08:00
|
|
|
|
Controls.Add(grpTextFolder);
|
2025-11-24 10:59:56 +08:00
|
|
|
|
Controls.Add(grpOutputFolder);
|
|
|
|
|
|
Controls.Add(pnlButtons);
|
|
|
|
|
|
Controls.Add(grpProgress);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
private GroupBox grpSourceFolder;
|
|
|
|
|
|
private Label lblSourcePath;
|
|
|
|
|
|
private TextBox txtSourcePath;
|
|
|
|
|
|
private Button btnBrowseSource;
|
2025-11-24 16:14:05 +08:00
|
|
|
|
private GroupBox grpTextFolder;
|
|
|
|
|
|
private Label lblTextPath;
|
|
|
|
|
|
private TextBox txtTextPath;
|
|
|
|
|
|
private Button btnBrowseText;
|
2025-11-24 10:59:56 +08:00
|
|
|
|
private GroupBox grpOutputFolder;
|
|
|
|
|
|
private Label lblOutputPath;
|
|
|
|
|
|
private TextBox txtOutputPath;
|
|
|
|
|
|
private Button btnBrowseOutput;
|
|
|
|
|
|
private Panel pnlButtons;
|
|
|
|
|
|
private Button btnMerge;
|
|
|
|
|
|
private Button btnClear;
|
|
|
|
|
|
private Button btnExit;
|
|
|
|
|
|
private GroupBox grpProgress;
|
|
|
|
|
|
private ProgressBar progressBar;
|
2025-11-24 16:09:01 +08:00
|
|
|
|
private RichTextBox txtLog;
|
2025-11-24 10:59:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|