当前位置: 首页 > news >正文

c# PDF文件合并工具

界面

主要用于发票PDF文件的合并。经常出差要报销的很有用。

代码

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using iTextSharp.text;
using iTextSharp.text.pdf;
//using PdfSharp.Pdf;
//using PdfSharp.Pdf.IO;namespace PdfMergeApp
{public partial class Form1 : Form{public Form1(){InitializeComponent();btnOpenDir.Enabled = false;}private List<string> pdfList;private string outputPdfDir;private void bntSelectDir_Click(object sender, EventArgs e){FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();DialogResult dialogResult = folderBrowserDialog.ShowDialog();if (dialogResult == DialogResult.OK){string selectedFolderPath = folderBrowserDialog.SelectedPath;//Console.WriteLine("选择的目录是: " + selectedFolderPath);txtFileDir.Text = selectedFolderPath;pdfList = Directory.GetFiles(selectedFolderPath, "*.pdf").ToList();if (pdfList != null && pdfList.Count > 0){pdfList = pdfList.OrderBy(t => t).ToList();}addPdfList();}}private void addPdfList(){this.listViewWorkLogs.Items.Clear();int no = 1;foreach (var item in pdfList){ListViewItem lvItem = new ListViewItem();lvItem.ForeColor = Color.Blue;lvItem.Text = no.ToString();lvItem.StateImageIndex = 0;lvItem.Tag = no - 1;lvItem.SubItems.Add(item);this.listViewWorkLogs.Items.Add(lvItem);no++;}}/// <summary>/// 合并多个PDF文件为一个PDF文件/// </summary>/// <param name="inputFolderPath"></param>/// <param name="outputFolderPath"></param>/// <param name="outputPdfName"></param>public void MergePDFs(string outputFilePath, params string[] inputFilePaths){// 获取输入文件夹中所有的PDF文件  //string[] inputFiles = Directory.GetFiles(inputFolderPath, "*.pdf");// 创建输出PDF文件路径  //string outputPdfPath = Path.Combine(outputFolderPath, outputPdfName);// 检查新输出文件是否已存在  if (File.Exists(outputFilePath)){// 如果已存在,则删除旧文件并创建新文件  File.Delete(outputFilePath);}// 创建输出PDF文件  using (FileStream stream = new FileStream(outputFilePath, FileMode.Create)){Document pdfDoc = new Document();PdfCopy pdf = new PdfCopy(pdfDoc, stream);pdfDoc.Open();foreach (string file in inputFilePaths){// 读取每个PDF文件并将其页面添加到输出PDF中  PdfReader reader = new PdfReader(file);int n = reader.NumberOfPages;for (int i = 1; i <= n; i++){pdf.AddPage(pdf.GetImportedPage(reader, i));}reader.Close();}if (pdfDoc != null) pdfDoc.Close();stream.Close();}}/// <summary>/// 合并多个PDF文件为一个PDF文件/// </summary>/// <param name="inputFolderPath"></param>/// <param name="outputFolderPath"></param>/// <param name="outputPdfName"></param>public void MergePDFs(string inputFolderPath, string outputFolderPath, string outputPdfName){// 获取输入文件夹中所有的PDF文件  string[] inputFiles = Directory.GetFiles(inputFolderPath, "*.pdf");// 创建输出PDF文件路径  string outputPdfPath = Path.Combine(outputFolderPath, outputPdfName);outputPdfPath.CreateDirectoryByPath();// 创建输出PDF文件  using (FileStream stream = new FileStream(outputPdfPath, FileMode.Create)){Document pdfDoc = new Document();PdfCopy pdf = new PdfCopy(pdfDoc, stream);pdfDoc.Open();foreach (string file in inputFiles){// 读取每个PDF文件并将其页面添加到输出PDF中  PdfReader reader = new PdfReader(file);int n = reader.NumberOfPages;for (int i = 1; i <= n; i++){pdf.AddPage(pdf.GetImportedPage(reader, i));}reader.Close();}if (pdfDoc != null) pdfDoc.Close();stream.Close();}string newOutputPdfPath = Path.Combine(outputFolderPath, "AllPDF_Merged.pdf");//string newOutputPdfPath = Path.Combine(outputFolderPath, outputPdfName);// 检查新输出文件是否已存在  if (File.Exists(newOutputPdfPath)){// 如果已存在,则删除旧文件并创建新文件  File.Delete(newOutputPdfPath);}// 重命名输出PDF文件  File.Move(outputPdfPath, newOutputPdfPath);}/// <summary>/// 合并多个PDF文件为一个PDF文件/// </summary>/// <param name="inputFolderPath"></param>/// <param name="outputFolderPath"></param>/// <param name="outputPdfName"></param>public bool MergePDFs(string outputFolderPath, string outputPdfName){var isOk = false;try{// 获取输入文件夹中所有的PDF文件  //string[] inputFiles = Directory.GetFiles(inputFolderPath, "*.pdf");// 创建输出PDF文件路径  string outputPdfPath = Path.Combine(outputFolderPath, outputPdfName);outputPdfPath.CreateDirectoryByPath();// 创建输出PDF文件  using (FileStream stream = new FileStream(outputPdfPath, FileMode.Create)){Document pdfDoc = new Document();PdfCopy pdf = new PdfCopy(pdfDoc, stream);pdfDoc.Open();foreach (string file in pdfList){// 读取每个PDF文件并将其页面添加到输出PDF中  PdfReader reader = new PdfReader(file);int n = reader.NumberOfPages;for (int i = 1; i <= n; i++){pdf.AddPage(pdf.GetImportedPage(reader, i));}reader.Close();}if (pdfDoc != null) pdfDoc.Close();stream.Close();}string newOutputPdfPath = Path.Combine(outputFolderPath, "AllPDF_Merged.pdf");//string newOutputPdfPath = Path.Combine(outputFolderPath, outputPdfName);// 检查新输出文件是否已存在  if (File.Exists(newOutputPdfPath)){// 如果已存在,则删除旧文件并创建新文件  File.Delete(newOutputPdfPath);}// 重命名输出PDF文件  File.Move(outputPdfPath, newOutputPdfPath);isOk = true;}catch (Exception ex){MessageBox.Show("合并异常:" + ex.Message);}return isOk;}private void btnMergePDF_Click(object sender, EventArgs e){if (pdfList != null && pdfList.Count > 0){var outputFilePath = txtFileDir.Text + "\\MergePDF_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".pdf";//MergePDFs(outputFilePath, pdfList.ToArray());var outputPdfName = "MergePDF_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".pdf";var outputPdfNameAll = txtFileDir.Text + "\\MergePDF\\" + outputPdfName;outputPdfDir = txtFileDir.Text + "\\MergePDF";//MergePDFs(txtFileDir.Text, txtFileDir.Text+ "\\MergePDF", outputPdfName);var isOk = MergePDFs(outputPdfDir, outputPdfName);if (isOk){lblResult.Text = "合并完成。输出文件目录:" + outputPdfNameAll;btnOpenDir.Enabled = true;MessageBox.Show("合并完成");}                }else{MessageBox.Show("你没有要合并的PDF文件");}}private void btnOpenDir_Click(object sender, EventArgs e){if (!string.IsNullOrEmpty(outputPdfDir)){OpenDirectory(outputPdfDir);}else{MessageBox.Show("合并文件没有生成");}}static void OpenDirectory(string path){ProcessStartInfo startInfo = new ProcessStartInfo{Arguments = path,FileName = "explorer.exe"};Process.Start(startInfo);}private void listViewWorkLogs_ItemCheck(object sender, ItemCheckEventArgs e){var listViewItem = sender as ListViewItem;var index = listViewItem.Tag;var a = 0;}private int selectIndex;private int newIndex;//private string selectFileName;private void listViewWorkLogs_SelectedIndexChanged(object sender, EventArgs e){if (listViewWorkLogs.SelectedItems.Count > 0){var listViewItem = listViewWorkLogs.SelectedItems[0];selectIndex = (int)listViewItem.Tag;newIndex = selectIndex;}}private void btnMoveUp_Click(object sender, EventArgs e){if (pdfList != null && pdfList.Count > 0){newIndex--;if (newIndex >= 0 && newIndex < pdfList.Count){var selectFileName = pdfList[selectIndex];pdfList[selectIndex] = pdfList[newIndex];pdfList[newIndex] = selectFileName;selectIndex = newIndex;addPdfList();}else{newIndex = 0;}}}private void btnMoveDown_Click(object sender, EventArgs e){if (pdfList != null && pdfList.Count > 0){newIndex++;if (newIndex < pdfList.Count){var selectFileName = pdfList[selectIndex];pdfList[selectIndex] = pdfList[newIndex];pdfList[newIndex] = selectFileName;selectIndex = newIndex;addPdfList();}else{newIndex = pdfList.Count - 1;}}}}
}

UI代码


namespace PdfMergeApp
{partial class Form1{/// <summary>/// 必需的设计器变量。/// </summary>private System.ComponentModel.IContainer components = null;/// <summary>/// 清理所有正在使用的资源。/// </summary>/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>protected override void Dispose(bool disposing){if (disposing && (components != null)){components.Dispose();}base.Dispose(disposing);}#region Windows 窗体设计器生成的代码/// <summary>/// 设计器支持所需的方法 - 不要修改/// 使用代码编辑器修改此方法的内容。/// </summary>private void InitializeComponent(){this.label1 = new System.Windows.Forms.Label();this.txtFileDir = new System.Windows.Forms.TextBox();this.button1 = new System.Windows.Forms.Button();this.bntSelectDir = new System.Windows.Forms.Button();this.btnMergePDF = new System.Windows.Forms.Button();this.groupBox1 = new System.Windows.Forms.GroupBox();this.listViewWorkLogs = new System.Windows.Forms.ListView();this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));this.groupBox2 = new System.Windows.Forms.GroupBox();this.lblResult = new System.Windows.Forms.Label();this.btnOpenDir = new System.Windows.Forms.Button();this.btnMoveUp = new System.Windows.Forms.Button();this.btnMoveDown = new System.Windows.Forms.Button();this.groupBox1.SuspendLayout();this.groupBox2.SuspendLayout();this.SuspendLayout();// // label1// this.label1.AutoSize = true;this.label1.Location = new System.Drawing.Point(12, 9);this.label1.Name = "label1";this.label1.Size = new System.Drawing.Size(75, 15);this.label1.TabIndex = 0;this.label1.Text = "选择目录:";// // txtFileDir// this.txtFileDir.Location = new System.Drawing.Point(90, 6);this.txtFileDir.Name = "txtFileDir";this.txtFileDir.ReadOnly = true;this.txtFileDir.Size = new System.Drawing.Size(491, 25);this.txtFileDir.TabIndex = 1;// // button1// this.button1.Location = new System.Drawing.Point(120, 141);this.button1.Name = "button1";this.button1.Size = new System.Drawing.Size(8, 8);this.button1.TabIndex = 2;this.button1.Text = "button1";this.button1.UseVisualStyleBackColor = true;// // bntSelectDir// this.bntSelectDir.Location = new System.Drawing.Point(600, 6);this.bntSelectDir.Name = "bntSelectDir";this.bntSelectDir.Size = new System.Drawing.Size(118, 35);this.bntSelectDir.TabIndex = 3;this.bntSelectDir.Text = "选择目录";this.bntSelectDir.UseVisualStyleBackColor = true;this.bntSelectDir.Click += new System.EventHandler(this.bntSelectDir_Click);// // btnMergePDF// this.btnMergePDF.Location = new System.Drawing.Point(724, 7);this.btnMergePDF.Name = "btnMergePDF";this.btnMergePDF.Size = new System.Drawing.Size(94, 32);this.btnMergePDF.TabIndex = 3;this.btnMergePDF.Text = "合并PDF";this.btnMergePDF.UseVisualStyleBackColor = true;this.btnMergePDF.Click += new System.EventHandler(this.btnMergePDF_Click);// // groupBox1// this.groupBox1.Controls.Add(this.listViewWorkLogs);this.groupBox1.Location = new System.Drawing.Point(15, 49);this.groupBox1.Name = "groupBox1";this.groupBox1.Size = new System.Drawing.Size(764, 589);this.groupBox1.TabIndex = 4;this.groupBox1.TabStop = false;this.groupBox1.Text = "文件列表";// // listViewWorkLogs// this.listViewWorkLogs.BackColor = System.Drawing.SystemColors.InactiveCaption;this.listViewWorkLogs.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {this.columnHeader1,this.columnHeader2});this.listViewWorkLogs.Dock = System.Windows.Forms.DockStyle.Fill;this.listViewWorkLogs.FullRowSelect = true;this.listViewWorkLogs.GridLines = true;this.listViewWorkLogs.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;this.listViewWorkLogs.HideSelection = false;this.listViewWorkLogs.ImeMode = System.Windows.Forms.ImeMode.NoControl;this.listViewWorkLogs.LabelWrap = false;this.listViewWorkLogs.Location = new System.Drawing.Point(3, 21);this.listViewWorkLogs.MultiSelect = false;this.listViewWorkLogs.Name = "listViewWorkLogs";this.listViewWorkLogs.Size = new System.Drawing.Size(758, 565);this.listViewWorkLogs.TabIndex = 2;this.listViewWorkLogs.UseCompatibleStateImageBehavior = false;this.listViewWorkLogs.View = System.Windows.Forms.View.Details;this.listViewWorkLogs.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.listViewWorkLogs_ItemCheck);this.listViewWorkLogs.SelectedIndexChanged += new System.EventHandler(this.listViewWorkLogs_SelectedIndexChanged);// // columnHeader1// this.columnHeader1.Text = "序号";this.columnHeader1.Width = 50;// // columnHeader2// this.columnHeader2.Text = "文件名";this.columnHeader2.Width = 580;// // groupBox2// this.groupBox2.Controls.Add(this.lblResult);this.groupBox2.Controls.Add(this.btnOpenDir);this.groupBox2.Location = new System.Drawing.Point(15, 644);this.groupBox2.Name = "groupBox2";this.groupBox2.Size = new System.Drawing.Size(809, 68);this.groupBox2.TabIndex = 5;this.groupBox2.TabStop = false;this.groupBox2.Text = "合并结果";// // lblResult// this.lblResult.AutoSize = true;this.lblResult.Location = new System.Drawing.Point(17, 34);this.lblResult.Name = "lblResult";this.lblResult.Size = new System.Drawing.Size(55, 15);this.lblResult.TabIndex = 0;this.lblResult.Text = "label2";// // btnOpenDir// this.btnOpenDir.Location = new System.Drawing.Point(709, 24);this.btnOpenDir.Name = "btnOpenDir";this.btnOpenDir.Size = new System.Drawing.Size(94, 32);this.btnOpenDir.TabIndex = 3;this.btnOpenDir.Text = "查看文件";this.btnOpenDir.UseVisualStyleBackColor = true;this.btnOpenDir.Click += new System.EventHandler(this.btnOpenDir_Click);// // btnMoveUp// this.btnMoveUp.Location = new System.Drawing.Point(785, 141);this.btnMoveUp.Name = "btnMoveUp";this.btnMoveUp.Size = new System.Drawing.Size(33, 42);this.btnMoveUp.TabIndex = 6;this.btnMoveUp.Text = "上移";this.btnMoveUp.UseVisualStyleBackColor = true;this.btnMoveUp.Click += new System.EventHandler(this.btnMoveUp_Click);// // btnMoveDown// this.btnMoveDown.Location = new System.Drawing.Point(785, 224);this.btnMoveDown.Name = "btnMoveDown";this.btnMoveDown.Size = new System.Drawing.Size(33, 42);this.btnMoveDown.TabIndex = 6;this.btnMoveDown.Text = "下移";this.btnMoveDown.UseVisualStyleBackColor = true;this.btnMoveDown.Click += new System.EventHandler(this.btnMoveDown_Click);// // Form1// this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;this.ClientSize = new System.Drawing.Size(836, 724);this.Controls.Add(this.btnMoveDown);this.Controls.Add(this.btnMoveUp);this.Controls.Add(this.groupBox2);this.Controls.Add(this.groupBox1);this.Controls.Add(this.btnMergePDF);this.Controls.Add(this.bntSelectDir);this.Controls.Add(this.button1);this.Controls.Add(this.txtFileDir);this.Controls.Add(this.label1);this.Name = "Form1";this.Text = "PDF文件合并";this.groupBox1.ResumeLayout(false);this.groupBox2.ResumeLayout(false);this.groupBox2.PerformLayout();this.ResumeLayout(false);this.PerformLayout();}#endregionprivate System.Windows.Forms.Label label1;private System.Windows.Forms.TextBox txtFileDir;private System.Windows.Forms.Button button1;private System.Windows.Forms.Button bntSelectDir;private System.Windows.Forms.Button btnMergePDF;private System.Windows.Forms.GroupBox groupBox1;private System.Windows.Forms.ListView listViewWorkLogs;private System.Windows.Forms.ColumnHeader columnHeader1;private System.Windows.Forms.ColumnHeader columnHeader2;private System.Windows.Forms.GroupBox groupBox2;private System.Windows.Forms.Label lblResult;private System.Windows.Forms.Button btnOpenDir;private System.Windows.Forms.Button btnMoveUp;private System.Windows.Forms.Button btnMoveDown;}
}

程序下载

https://download.csdn.net/download/cjh16606260986/90289204

相关文章:

c# PDF文件合并工具

界面 主要用于发票PDF文件的合并。经常出差要报销的很有用。 代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.IO; using System.Linq; using System…...

【16届蓝桥杯寒假刷题营】第1期DAY5

5.依依的询问最小值 - 蓝桥云课 问题描述 依依有个长度为 n 的序列 a&#xff0c;下标从 1 开始。 她有 m 次查询操作&#xff0c;每次她会查询下标区间在 [li​,ri​] 的 a 中元素和。她想知道你可以重新排序序列 a&#xff0c;使得这 m 次查询的总和最小。 求你求出 m 次…...

.NET周刊【1月第1期 2025-01-05】

国内文章 3款.NET开源、功能强大的通讯调试工具&#xff0c;效率提升利器&#xff01; https://www.cnblogs.com/Can-daydayup/p/18631410 本文介绍了三款功能强大的.NET开源通讯调试工具&#xff0c;旨在提高调试效率。这些工具包括LLCOM&#xff0c;提供串口调试和自动化处…...

(7)(7.2) 围栏

文章目录 前言 1 通用设置 2 围栏类型 3 破坏栅栏行动 4 使用 RC 通道辅助开关启用栅栏 5 自动高度规避 6 在任务规划器中启用围栏 7 用于遥控飞行训练 8 MAVLink 支持 前言 ArduPilot 支持基于本机的圆柱形&#xff08;“TinCan”&#xff09;和多边形和/或圆柱形、…...

1166 Summit (25)

A summit (峰会) is a meeting of heads of state or government. Arranging the rest areas for the summit is not a simple job. The ideal arrangement of one area is to invite those heads so that everyone is a direct friend of everyone. Now given a set of tenta…...

linux_socket

udp 通信 server #include <iostream> #include <arpa/inet.h> #include <unistd.h> #include <cstring>using namespace std;#define UPORT 12511int main(){int sock socket(AF_INET, SOCK_DGRAM, 0); // 创建一个UDP套接字if (sock -1) {cout&…...

Linux探秘坊-------3.开发工具详解(2)

1.动静态库和动静态链接&#xff08;操作&#xff09; 静态库是指编译链接时,把库⽂件的代码全部加⼊到可执⾏⽂件中,因此⽣成的⽂件 ⽐较⼤,但在运⾏时也就不再需要库⽂件了。其后缀名⼀般为“.a” 动态库与之相反,在编译链接时并 没有把库⽂件的代码加⼊到可执⾏⽂件中 ,⽽…...

Mysql InnoDB B+Tree是什么?

“mysql中常用的数据库搜索引擎InnoDB,其索引通过BTree的方式进行构建。” 实在想不起来BTree是怎么一回事了。以点带线&#xff0c;将涉及到的数据结构一起复习一下。 文章目录 数据结构定义红黑树定义使命 BTree定义使命 BTree定义 InnoDB BTree 旋转与调整二叉排序树插入删…...

C语言进阶习题【1】指针和数组(1)——一维数组

1. 数组名的意义&#xff1a; sizeof(数组名)&#xff0c;这里的数组名表示整个数组&#xff0c;计算的是整个数组的大小。&数组名&#xff0c;这里的数组名表示整个数组&#xff0c;取出的是整个数组的地址。除此之外所有的数组名都表示首元素的地址。&#xff08;一维数…...

2024:成长、创作与平衡的年度全景回顾

文章目录 1.前言2.突破自我&#xff1a;2024年个人成长与关键突破3.创作历程&#xff1a;从构想到落笔&#xff0c;2024年的文字旅程4.生活与学业的双重奏&#xff1a;如何平衡博客事业与个人生活5.每一步都是前行&#xff1a;2024年度的挑战与收获6.总结 1.前言 回首2024年&a…...

【Linux】网络基础探索:开启你的网络之旅

&#x1f308; 个人主页&#xff1a;Zfox_ &#x1f525; 系列专栏&#xff1a;Linux 目录 一&#xff1a;&#x1f525; 计算机网络背景 &#x1f98b; 1-1 网络发展 二&#xff1a;&#x1f525; 初识协议 &#x1f98b; 2-1 协议分层协议分层 vs. 软件分层 &#x1f98b; 2-…...

function isBulkReadStatement, file SQLiteDatabaseTracking.cpp

一问题&#xff1a;Xcode16.0运行在iPhone16/ios18.0 以上发生闪退&#xff0c; 闪退在 YYCache–>YYKVStorage 文件内。 以上删除保以下错误&#xff1a; function isBulkReadStatement, file SQLiteDatabaseTracking.cpp 解决方案&#xff1a; 找到YYKVStorage文件中_d…...

React 中hooks之useTransition使用总结

目录 概述基本用法使用场景最佳实践注意事项 概述 什么是 useTransition? useTransition 是 React 18 引入的新 Hook&#xff0c;用于标记非紧急的状态更新。它允许组件在状态转换期间保持响应&#xff0c;通过将某些更新标记为"过渡"来推迟它们的渲染。 主要特…...

leetcode 3097. 或值至少为 K 的最短子数组 II 中等

给你一个 非负 整数数组 nums 和一个整数 k 。 如果一个数组中所有元素的按位或运算 OR 的值 至少 为 k &#xff0c;那么我们称这个数组是 特别的 。 请你返回 nums 中 最短特别非空 子数组 的长度&#xff0c;如果特别子数组不存在&#xff0c;那么返回 -1 。 示例 1&…...

C# OpenCV机器视觉:特征匹配 “灵魂伴侣”

在一个阳光仿佛被施了魔法&#xff0c;欢快得直蹦跶的早晨&#xff0c;阿强像个即将踏上神秘寻宝之旅的探险家&#xff0c;一屁股墩在实验室那张堆满各种奇奇怪怪小玩意儿的桌前。桌上&#xff0c;零件、线路、半成品设备乱成一团&#xff0c;唯有他那宝贝电脑屏幕散发着清冷又…...

DDD - 整洁架构_解决技术设计困局

文章目录 Pre如何落地 DDD底层技术的更迭 整洁架构的设计主动适配器/北向适配器被动适配器/南向适配器 整洁架构的落地总结 Pre DDD - 软件退化原因及案例分析 DDD - 如何运用 DDD 进行软件设计 DDD - 如何运用 DDD 进行数据库设计 DDD - 服务、实体与值对象的两种设计思路…...

金融项目实战 07|Python实现接口自动化——连接数据库和数据清洗、测试报告、持续集成

目录 一、投资模块&#xff08;投资接口投资业务&#xff09; 二、连接数据库封装 和 清洗数据 1、连接数据库 2、数据清洗 4、调用 三、批量执行测试用例 并 生成测试报告 四、持续集成 1、代码上传gitee 2、Jenkin持续集成 一、投资模块&#xff08;投资接口投资业务…...

Ceph与RAID在存储中的协同工作过程

本文将结合架构图&#xff0c;详细讲解Ceph与RAID如何在存储环境中相互配合&#xff0c;共同提供高效且可靠的存储服务。 架构概述 从上图中可以看到&#xff0c;Ceph的架构主要分为四个层次&#xff1a; 客户端和服务接口层&#xff1a;这一层包括客户端访问存储应用的接口…...

《重生到现代之从零开始的C++生活》—— 类和对象2

类的默认成员函数 默认成员函数就是用户没有显示实现&#xff0c;编译器会自动生成的成员函数&#xff0c;一个类会默认生成6个成员函数 构造函数 构造函数时特殊的成员函数&#xff0c;构造函数的初始化对象 函数名与类名相同 没有返回值 对象实例化的时候胡自动调用构造…...

MFC 使用 32位带Alpha通道的位图

最近需要做一个MFC界面上的图片,众所周知,MFC 好像只支持 bmp 格式的! 先看我的原始24位图片,RGB 三个颜色各占8位 (256色), 所以是24位。 如果放到MFC界面上,是这个很丑的效果 它是一个正方形图片,周围的白色可以看见。 解下来,进入今天的主题: 32位带 Alpha 通…...

QT:子控件VLC播放视频时,父控件无法截取鼠标事件

具体来说&#xff1a; 反复验证&#xff0c;结论正确。只要是播放区&#xff08;即传递给VLC的窗口区域&#xff09;&#xff0c;就无法点击。 比如WidgetA&#xff0c;新建一个WidgetB&#xff0c;设置位置时留有一点边框。这个时候WidgetA的边框区是能收到鼠标事件的。 这…...

力扣 739. 每日温度

&#x1f517; https://leetcode.cn/problems/daily-temperatures 题目 给定一个数组&#xff0c;表示每天的天气返回一个数组&#xff0c;index i 表示几天后比当前的温度要高&#xff0c;没有则为 0 思路 维护一个单调递减栈&#xff0c;若当前的温度比栈顶大&#xff0c…...

蓝桥杯 阶乘的和(C++完整代码+详细分析)

题目描述 原题链接 阶乘的和 问题描述 给定 n 个数 Ai​&#xff0c;问能满足 m! 为 ∑(Ai!) 的因数的最大的 m 是多少。其中 m! 表示 m 的阶乘&#xff0c;即 123⋯m。 输入格式 输入的第一行包含一个整数 n。 第二行包含 n 个整数&#xff0c;分别表示 Ai​&#xff0c;相…...

OpenAI进军实体机器人:GPT赋能的智能未来

近年来&#xff0c;人工智能技术飞速发展&#xff0c;深刻地改变着我们的生活。而OpenAI作为人工智能领域的领军者&#xff0c;其最新动作更是引人注目&#xff1a;进军实体机器人领域&#xff01;这不仅标志着人工智能技术应用场景的重大拓展&#xff0c;也预示着未来智能机器…...

【Python运维】用Python管理Docker容器:从`docker-py`到自动化部署的全面指南

《Python OpenCV从菜鸟到高手》带你进入图像处理与计算机视觉的大门! 解锁Python编程的无限可能:《奇妙的Python》带你漫游代码世界 在现代软件开发和运维过程中,Docker容器化技术因其高效、轻量和可移植性而被广泛应用。Python作为一种灵活且功能强大的编程语言,通过doc…...

【机器学习实战入门项目】MNIST数字分类机器学习项目

Python 深度学习项目&#xff1a;手写数字识别 为了使机器更加智能&#xff0c;开发者们正在深入研究机器学习和深度学习技术。人类通过不断练习和重复来学习执行某项任务&#xff0c;从而记住如何完成这些任务。然后&#xff0c;大脑中的神经元会自动触发&#xff0c;他们能够…...

【统计信号处理基础——估计与检测理论】Vol1.Ch1 引言

文章目录 1. 信号处理中的估计2. 估计的数学问题3. 估计量性能评估习题1.11.21.31.41.5 1. 信号处理中的估计 从离散时间波形或一组数据集中提取参数的问题。我们有 N N N点数据集 { x [ 0 ] , x [ 1 ] , ⋯ , x [ N − 1 ] } \{x[0],x[1],\cdots,x[N-1]\} {x[0],x[1],⋯,x[N−…...

Linux 存储设备和 Ventoy 启动盘制作指南

一、Linux 存储设备基础知识 1. 设备路径&#xff08;/dev&#xff09; 设备路径是 Linux 系统中物理存储设备的唯一标识&#xff0c;类似设备的"身份证号"。 命名规则解析 /dev/sda&#xff1a; /dev&#xff1a;device&#xff08;设备&#xff09;的缩写&…...

第14章:Python TDD应对货币类开发变化(一)

写在前面 这本书是我们老板推荐过的&#xff0c;我在《价值心法》的推荐书单里也看到了它。用了一段时间 Cursor 软件后&#xff0c;我突然思考&#xff0c;对于测试开发工程师来说&#xff0c;什么才更有价值呢&#xff1f;如何让 AI 工具更好地辅助自己写代码&#xff0c;或许…...

网络协议入门:OSI模型与TCP/IP栈

在网络通信的世界中&#xff0c;数据从一台设备传输到另一台设备&#xff0c;需要遵循一系列规则&#xff0c;这些规则统称为网络协议。OSI模型和TCP/IP协议栈作为网络通信的基石&#xff0c;帮助我们理解数据传输的全流程。这篇文章将深入解析它们的结构、功能和实际应用&…...

pthread_exit函数

pthread_exit 是 POSIX 线程库&#xff08;pthread&#xff09;中的一个函数&#xff0c;用于显式地终止调用线程。与 exit 函数不同&#xff0c;pthread_exit 仅影响调用它的线程&#xff0c;而不是整个进程。使用 pthread_exit 可以确保线程在退出时能够正确地释放线程相关的…...

从语音识别到图像识别:AI如何“看”和“听”

引言 随着人工智能技术的不断进步&#xff0c;AI的“听”和“看”能力正变得越来越强大。从语音识别到图像识别&#xff0c;AI不仅能够通过声音与我们互动&#xff0c;还能通过视觉理解和分析周围的世界。这些技术不仅改变了我们与机器的交互方式&#xff0c;也在各行各业中带…...

UML-对象图(Object Diagram)

定义 在UML(统一建模语言)中,对象图用于描述在某一时刻,一组对象以及它们之间关系的图形。它是系统详细状态在某一时刻的快照,常用于表示复杂的类图的一个实例。关联、依赖和继承是对象图中常见的三种关系,下面将对这三种关系进行详细说明,并阐述它们之间的区别。 Pla…...

Pytorch - YOLOv11自定义资料训练

►前言 本篇将讲解目前最新推出的YOLOv11搭配Roboflow进行自定义资料标注训练流程&#xff0c;透过Colab上进行实作说明&#xff0c;使大家能够容易的了解YOLOv11的使用。 ►YOLO框架下载与导入 ►Roboflow的资料收集与标注 进行自定义资料集建置与上传 透过Roboflow工具进行…...

大模型GUI系列论文阅读 DAY2续2:《使用指令微调基础模型的多模态网页导航》

摘要 自主网页导航的进展一直受到以下因素的阻碍&#xff1a; 依赖于数十亿次的探索性交互&#xff08;通常采用在线强化学习&#xff09;&#xff0c;依赖于特定领域的模型设计&#xff0c;难以利用丰富的跨领域数据进行泛化。 在本研究中&#xff0c;我们探讨了基于视觉-语…...

Docker 搭建mysql 连接超时问题,xxl-job启动mysql连接报错,禁用dns

1.本地连接Navicat报错信息&#xff0c;猜测是navicat默认连接超时导致的&#xff0c;后面换成idea一个插件虽然慢但连接上了 2013 - Lost connection to MySQL server at reading initial communication packet 2.启动xxl-job会报错&#xff0c;网上有人mysql驱动与数据库不匹…...

SSM课设-学生管理系统

【课设者】SSM课设-学生管理系统 技术栈: 后端: SpringSpringMVCMybatisMySQLJSP 前端: HtmlCssJavaScriptEasyUIAjax 功能: 学生端: 登陆 学生信息管理 个人信息管理 老师端: 多了教师信息管理 管理员端: 多了班级信息管理 多了年级信息管理 多了系统用户管理...

JavaScript笔记APIs篇03——DOM节点Bom操作本地存储正则表达式

黑马程序员视频地址&#xff1a;黑马程序员前端JavaScript入门到精通全套视频教程https://www.bilibili.com/video/BV1Y84y1L7Nn?vd_source0a2d366696f87e241adc64419bf12cab&spm_id_from333.788.videopod.episodes&p78https://www.bilibili.com/video/BV1Y84y1L7Nn?…...

JS 有哪些模块化规范

一、CommonJS 规范 1. 主要应用场景 主要用于服务器端开发&#xff0c;尤其是 Node.js 环境。 2. 核心思想 使用 require() 函数来引入模块&#xff0c;使用 module.exports 或 exports 对象来导出模块中的内容。 // math.js 模块const add (a, b) > a b;const subtr…...

摘录人工智能面试笔试题汇总

一、人工智能面试问答题汇总 1、什么是人工智能&#xff1f; 人工智能&#xff08;AI&#xff09;是一种计算机科学&#xff0c;它增强了像人类一样工作和反应的智能机器。机器模拟人类智能行为的能力。人工智能通常用于各种应用&#xff0c;如决策、语音识别、感知、认知能力…...

【PCIe 总线及设备入门学习专栏 6.1 -- PCIe MCTP】

文章目录 1 什么是 MCTP?2 MCTP 消息在 PCIe 中的传输特点3 PCIe MCTP 的局限性(1) 出站(Outbound)MCTP 消息分解的限制(2) 入站(Inbound)MCTP 消息组装的限制4 MCTP 消息的实际使用流程发送端处理流程接收端处理流程5 实际使用场景例 1:管理命令传输例 2:监控数据报告例…...

RabbitMQ集群安装rabbitmq_delayed_message_exchange

1、单节点安装rabbitmq安装延迟队列 安装延迟队列rabbitmq_delayed_message_exchange可以参考这个文章&#xff1a; rabbitmq安装延迟队列-CSDN博客 2、集群安装rabbitmq_delayed_message_exchange 在第二个节点 join_cluster 之后&#xff0c;start_app 就会报错了 (CaseC…...

doris 2.1 Queries Acceleration-Hints 学习笔记

1 Hint Classification 1.1 Leading Hint:Specifies the join order according to the order provided in the leading hint. 1.2 Ordered Hint:A specific type of leading hint that specifies the join order as the original text sequence. 1.3 Distribute Hint:Speci…...

【网络协议】【http】【https】TLS解决了HTTP存在的问题-加密通信+摘要,数字签名+CA证书

【网络协议】【http】【https】TLS解决了HTTP存在的问题-加密通信摘要数字签名CA证书 ps:TLS前期发送的密码套件里面主要就是约定&#xff1a;密钥交换算法&#xff0c;签名算法&#xff0c;对称加密算法&#xff0c;摘要算法 1加密通信 一般选择非对称加密交换密钥 对称加密…...

某讯一面,感觉问Redis的难度不是很大

前不久&#xff0c;有位朋友去某讯面试&#xff0c;他说被问到了很多关于 Redis 的问题&#xff0c;比如为什么用 Redis 作为 MySQL 的缓存&#xff1f;Redis 中大量 key 集中过期怎么办&#xff1f;如何保证缓存和数据库数据的一致性&#xff1f;我将它们整理出来&#xff0c;…...

【json_object】mysql中json_object函数过长,显示不全

问题&#xff1a;json只显示部分 解决&#xff1a; SET GLOBAL group_concat_max_len 1000000; -- 设置为1MB&#xff0c;根据需要调整如果当前在navicat上修改&#xff0c;只有效本次连接和后续会话&#xff0c;重新连接还是会恢复默认值1024 在my.ini配置文件中新增或者修…...

【KOA框架】koa框架基础入门

koa是express的一层封装&#xff0c;语法比express更加简洁。所以有必要了解下koa的相关开发方法。 代码实现 package.json {"name": "koapp","version": "1.0.0","main": "index.js","scripts": {&…...

kubernetes 集群 YAML 文件详解

Kubernetes 是一个开源的容器编排平台&#xff0c;用于自动化部署、扩展和管理容器化应用程序。在 Kubernetes 中&#xff0c;YAML 文件扮演着至关重要的角色&#xff0c;因为它们是用来定义资源对象&#xff08;如 Pods、Deployments、Services 等&#xff09;的配置文件。正确…...

【STM32G4xx的CAN驱动记录】

STM32G4xx的CAN驱动记录 CAN说明CAN的波特率计算数据测试总结 本文主要记录了基于STM32G4xx的CAN接口解析某型号雷达数据遇到的问题及规避方法&#xff0c;CAN总线波特率500Kbps&#xff0c;采样点要求80%附近。 注意CAN总线同步段的时间&#xff01;&#xff01;&#xff01; …...

VSCode下EIDE插件开发STM32

VSCode下STM32开发环境搭建 本STM32教程使用vscode的EIDE插件的开发环境&#xff0c;完全免费&#xff0c;有管理代码文件的界面&#xff0c;不需要其它IDE。 视频教程见本人的 VSCodeEIDE开发STM32 安装EIDE插件 Embedded IDE 嵌入式IDE 这个插件可以帮我们管理代码文件&am…...