JAVA批量发送邮件(含excel内容)
EmailSenderHtmlV1 是读取配置文件《批量发送邮件.xlsx》,配置sheet获取 发件人邮箱 邮箱账号 口令,发送excel数据sheet获取收件人邮箱 抄送人邮箱 邮件标题 第N行开始(N>=1,N=0默认表头) 第M行结束(M>=1,M=0默认表头) 附件文件夹 附件名,同时发送excel数据内容详情sheet配合发送excel数据sheet的第N和第M行信息,获取excel内容。
EmailSenderV1是读取配置文件《批量发送邮件.xlsx》,配置sheet获取 发件人邮箱 邮箱账号 口令,发送数据sheet 获取 收件人邮箱 抄送人邮箱 邮件标题 邮件内容 附件文件夹 , 附件名。
ExcelToHtmlConverter 是将excel数据内容详情sheet内单元格信息转换为html格式,作为邮件内容发送。
1.
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Properties;import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import javax.mail.MessagingException;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMultipart;
import javax.mail.internet.MimeUtility;import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;import org.apache.commons.mail.DefaultAuthenticator;
import org.apache.commons.mail.EmailAttachment;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.MultiPartEmail;
import org.apache.commons.mail.SimpleEmail;public class EmailSenderHtmlV1 {private String smtpServer;private String username;private String password;private String senderEmail;private boolean isMany;private String excelFile;private Sheet configSheet;private Sheet dataSheet;private String beginrow;private String endrow;public EmailSenderHtmlV1(boolean many, Properties smtpConfig, String excelFile) {setConfig(many, smtpConfig, excelFile);}public void setConfig(boolean many, Properties smtpConfig, String excelFile) {try {this.isMany = many;if (many) {this.excelFile = excelFile;FileInputStream file = new FileInputStream(new File(excelFile));// System.out.println(file.toString());Workbook workbook = new XSSFWorkbook(file);// System.out.println(workbook.toString());this.configSheet = workbook.getSheet("配置");// System.out.println(this.configSheet.toString());// 从配置表读取SMTP信息Row row = configSheet.getRow(1); // 第二行(index=1)this.smtpServer = row.getCell(0).getStringCellValue();this.senderEmail = row.getCell(1).getStringCellValue();this.username = row.getCell(2).getStringCellValue();this.password = row.getCell(3).getStringCellValue();workbook.close();file.close();} else {this.smtpServer = smtpConfig.getProperty("smtp_server");this.username = smtpConfig.getProperty("username");this.password = smtpConfig.getProperty("password");this.senderEmail = smtpConfig.getProperty("sender_email");}} catch (Exception e) {System.out.println("邮件配置错误:" + e.getMessage());System.exit(1);}}public void MultiSendEmail(Properties contentConfig) {MultiPartEmail email = new MultiPartEmail();// email.setTLS(true);// email.setSSL(true);// email.setDebug(true);email.setHostName(smtpServer);email.setSSLOnConnect(true);email.setSmtpPort(465);// 设置TLS协议(关键配置)System.setProperty("mail.smtp.ssl.protocols", "TLSv1.2");email.setAuthenticator(new DefaultAuthenticator(username, password));try {email.setFrom(senderEmail);// 发件人// 设置收件人String receiverEmail = contentConfig.getProperty("receiver_email");email.addTo(receiverEmail);// 设置抄送人String copyEmail = contentConfig.getProperty("copy_email");if (copyEmail != null && !copyEmail.isEmpty()) {email.addCc(copyEmail);}email.setCharset("UTF-8");email.setSubject(contentConfig.getProperty("subject"));email.setMsg(contentConfig.getProperty("message"));// 创建 HTML 内容部分MimeBodyPart htmlPart = new MimeBodyPart();String htmlContent = contentConfig.getProperty("message");try {htmlPart.setContent(htmlContent, "text/html; charset=utf-8");} catch (MessagingException e) {// TODO Auto-generated catch blocke.printStackTrace();}// 创建多部分内容MimeMultipart multipart = new MimeMultipart("mixed");try {multipart.addBodyPart(htmlPart);} catch (MessagingException e) {// TODO Auto-generated catch blocke.printStackTrace();}String attachmentPath = contentConfig.getProperty("attachment_path");String attachmentNames = contentConfig.getProperty("attachment_name");FileDataSource fds;if (attachmentNames != null && !attachmentNames.isEmpty()) {String[] files = attachmentNames.split(",");for (String fileName : files) {//attachment.setName(fileName);// 添加附件MimeBodyPart attachmentPart = new MimeBodyPart();try {fds = new FileDataSource(attachmentPath + File.separator + fileName);attachmentPart.setDataHandler(new DataHandler(fds));try {attachmentPart.setFileName(MimeUtility.encodeText(fileName, "UTF-8", "B"));} catch (UnsupportedEncodingException e) {// TODO Auto-generated catch blocke.printStackTrace();}multipart.addBodyPart(attachmentPart);} catch (MessagingException e) {// TODO Auto-generated catch blocke.printStackTrace();}}}// 设置完整内容email.setContent(multipart, "multipart/mixed");email.send();System.out.println("邮件发送成功");} catch (EmailException e) {// TODO Auto-generated catch blocke.printStackTrace();}}public void bulkSendEmail() {try {FileInputStream file = new FileInputStream(new File(excelFile));Workbook workbook = new XSSFWorkbook(file);Sheet sheet = workbook.getSheet("发送excel数据");// 从第二行(index=1)开始读取数据,第一行是表头for (int i = 1; i <= sheet.getLastRowNum(); i++) {Row row = sheet.getRow(i);if (row == null)continue;Properties contentConfig = new Properties();contentConfig.setProperty("receiver_email", getCellValue(row.getCell(0)));contentConfig.setProperty("copy_email", getCellValue(row.getCell(1)));contentConfig.setProperty("subject", getCellValue(row.getCell(2)));// contentConfig.setProperty("message", getCellValue(row.getCell(3)));contentConfig.setProperty("beginrow", getCellValue(row.getCell(3)));contentConfig.setProperty("endrow", getCellValue(row.getCell(4)));contentConfig.setProperty("attachment_path", getCellValue(row.getCell(5)));contentConfig.setProperty("attachment_name", getCellValue(row.getCell(6)));// getexcelcontent(getCellValue(row.getCell(3)),getCellValue(row.getCell(4)));ExcelToHtmlConverter eth = new ExcelToHtmlConverter(excelFile, getCellValue(row.getCell(3)),getCellValue(row.getCell(4)));contentConfig.setProperty("message", eth.convertExcelToHtml());MultiSendEmail(contentConfig);}workbook.close();file.close();} catch (IOException e) {System.out.println("读取Excel文件错误:" + e.getMessage());}}public void getexcelcontent(String beginrow, String endrow) {try {FileInputStream file = new FileInputStream(new File(excelFile));Workbook workbook = new XSSFWorkbook(file);Sheet sheet = workbook.getSheet("发送excel数据内容详情");// 从第二行(index=1)开始读取数据,第一行是表头for (int i = 1; i <= sheet.getLastRowNum(); i++) {Row row = sheet.getRow(i);if (row == null)continue;}// contentConfig.setProperty("message", getCellValue(row.getCell(3)));workbook.close();file.close();} catch (IOException e) {System.out.println("读取Excel文件错误:" + e.getMessage());}}private String getCellValue(Cell cell) {if (cell == null)return "";switch (cell.getCellType()) {case STRING:return cell.getStringCellValue();case NUMERIC:if (DateUtil.isCellDateFormatted(cell)) {return cell.getDateCellValue().toString();} else {return String.valueOf((int) cell.getNumericCellValue());}case BOOLEAN:return String.valueOf(cell.getBooleanCellValue());case FORMULA:return cell.getCellFormula();default:return "";}}
/*public static void main(String[] args) {// 批量发送邮件示例String excelFile = "D:/SendMail/批量发送邮件.xlsx";EmailSenderHtmlV1 emailSender = new EmailSenderHtmlV1(true, null, excelFile);emailSender.bulkSendEmail();}
*/
}
2.
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;import org.apache.commons.mail.DefaultAuthenticator;
import org.apache.commons.mail.EmailAttachment;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.MultiPartEmail;
import org.apache.commons.mail.SimpleEmail;public class EmailSenderV1 {private String smtpServer;private String username;private String password;private String senderEmail;private boolean isMany;private String excelFile;private Sheet configSheet;private Sheet dataSheet;public EmailSenderV1(boolean many, Properties smtpConfig, String excelFile) {setConfig(many, smtpConfig, excelFile);}public void setConfig(boolean many, Properties smtpConfig, String excelFile) {try {this.isMany = many;if (many) {this.excelFile = excelFile;FileInputStream file = new FileInputStream(new File(excelFile));// System.out.println(file.toString());Workbook workbook = new XSSFWorkbook(file);// System.out.println(workbook.toString());this.configSheet = workbook.getSheet("配置");// System.out.println(this.configSheet.toString());// 从配置表读取SMTP信息Row row = configSheet.getRow(1); // 第二行(index=1)this.smtpServer = row.getCell(0).getStringCellValue();this.senderEmail = row.getCell(1).getStringCellValue();this.username = row.getCell(2).getStringCellValue();this.password = row.getCell(3).getStringCellValue();workbook.close();file.close();} else {this.smtpServer = smtpConfig.getProperty("smtp_server");this.username = smtpConfig.getProperty("username");this.password = smtpConfig.getProperty("password");this.senderEmail = smtpConfig.getProperty("sender_email");}} catch (Exception e) {System.out.println("邮件配置错误:" + e.getMessage());System.exit(1);}}public void MultiSendEmail(Properties contentConfig) {MultiPartEmail email = new MultiPartEmail();// email.setTLS(true);// email.setSSL(true);// email.setDebug(true);email.setHostName(smtpServer);email.setSSLOnConnect(true);email.setSmtpPort(465);// 设置TLS协议(关键配置)System.setProperty("mail.smtp.ssl.protocols", "TLSv1.2");email.setAuthenticator(new DefaultAuthenticator(username, password));try {email.setFrom(senderEmail);// 发件人// 设置收件人String receiverEmail = contentConfig.getProperty("receiver_email");email.addTo(receiverEmail);// 设置抄送人String copyEmail = contentConfig.getProperty("copy_email");if (copyEmail != null && !copyEmail.isEmpty()) {email.addCc(copyEmail);}email.setCharset("UTF-8");email.setSubject(contentConfig.getProperty("subject"));email.setMsg(contentConfig.getProperty("message"));// 添加附件String attachmentPath = contentConfig.getProperty("attachment_path");String attachmentNames = contentConfig.getProperty("attachment_name");EmailAttachment attachment = new EmailAttachment();if (attachmentNames != null && !attachmentNames.isEmpty()) {String[] files = attachmentNames.split(",");for (String fileName : files) {attachment.setPath(attachmentPath + File.separator + fileName);attachment.setName(fileName);email.attach(attachment);// 添加附件}}email.send();System.out.println("邮件发送成功");} catch (EmailException e) {// TODO Auto-generated catch blocke.printStackTrace();}}public void bulkSendEmail() {try {FileInputStream file = new FileInputStream(new File(excelFile));Workbook workbook = new XSSFWorkbook(file);Sheet sheet = workbook.getSheet("发送数据");// 从第二行(index=1)开始读取数据,第一行是表头for (int i = 1; i <= sheet.getLastRowNum(); i++) {Row row = sheet.getRow(i);if (row == null)continue;Properties contentConfig = new Properties();contentConfig.setProperty("receiver_email", getCellValue(row.getCell(0)));contentConfig.setProperty("copy_email", getCellValue(row.getCell(1)));contentConfig.setProperty("subject", getCellValue(row.getCell(2)));contentConfig.setProperty("message", getCellValue(row.getCell(3)));contentConfig.setProperty("attachment_path", getCellValue(row.getCell(4)));contentConfig.setProperty("attachment_name", getCellValue(row.getCell(5)));MultiSendEmail(contentConfig);}workbook.close();file.close();} catch (IOException e) {System.out.println("读取Excel文件错误:" + e.getMessage());}}private String getCellValue(Cell cell) {if (cell == null)return "";switch (cell.getCellType()) {case STRING:return cell.getStringCellValue();case NUMERIC:if (DateUtil.isCellDateFormatted(cell)) {return cell.getDateCellValue().toString();} else {return String.valueOf((int) cell.getNumericCellValue());}case BOOLEAN:return String.valueOf(cell.getBooleanCellValue());case FORMULA:return cell.getCellFormula();default:return "";}}/*public static void main(String[] args) {// 批量发送邮件示例String excelFile = "D:/SendMail/批量发送邮件.xlsx";EmailSenderV1 emailSender = new EmailSenderV1(true, null, excelFile);emailSender.bulkSendEmail();}
*/}
3.
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;import java.io.*;public class ExcelToHtmlConverter {String excelFilePath;String sheetName;String beginrow;String endrow;public ExcelToHtmlConverter(String excelFilePath, String beginrow, String endrow) {this.excelFilePath = excelFilePath;this.sheetName = "发送excel数据内容详情";this.beginrow = beginrow;this.endrow = endrow;}
/*public static void main(String[] args) {String excelFilePath = "D:/SendMail/批量发送邮件.xlsx";String beginrow = null;String endrow = null;ExcelToHtmlConverter eth = new ExcelToHtmlConverter(excelFilePath, beginrow, endrow);try {eth.convertExcelToHtml();System.out.println("Excel转换为HTML成功!");} catch (IOException e) {System.err.println("转换失败:" + e.getMessage());e.printStackTrace();}}
*/public String convertExcelToHtml() throws IOException {String result = "";Workbook workbook = null;FileInputStream fileInputStream = null;if (excelFilePath.equals("") || excelFilePath == null) {return null;}try {// 读取Excel文件fileInputStream = new FileInputStream(new File(excelFilePath));// 根据文件扩展名创建不同的Workbookif (excelFilePath.toLowerCase().endsWith(".xlsx")) {workbook = new XSSFWorkbook(fileInputStream);} else if (excelFilePath.toLowerCase().endsWith(".xls")) {workbook = new HSSFWorkbook(fileInputStream);} else {throw new IllegalArgumentException("不支持的文件格式:" + excelFilePath);}// 获取指定工作表Sheet sheet = workbook.getSheet(sheetName);if (sheet == null) {throw new IllegalArgumentException("找不到工作表:" + sheetName);}// 写入HTML头部result += "<html>\n";result += "<head>\n";// result += "<meta charset=\"UTF-8\">\n";// result+="<title>Excel转HTML</title>\n";result += "<style>\n";result += " table { border-collapse: collapse; width: 100%; }\n";result += " th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }\n";result += " th { background-color: #f2f2f2; font-weight: bold; }\n";result += " tr:nth-child(even) { background-color: #f9f9f9; }\n";result += " tr:hover { background-color: #f5f5f5; }\n";result += "</style>\n";result += "</head>\n";result += "<body>\n";// 创建表格result += "<table>\n";// 第一行写入Row row1 = sheet.getRow(0);if (row1 == null) {return null;}// 写入行开始标签result += " <tr>\n";// 获取当前行的最大列数int lastCellNum1 = row1.getLastCellNum();if (lastCellNum1 < 0) {lastCellNum1 = 0;}for (int cellIndex1 = 0; cellIndex1 < lastCellNum1; cellIndex1++) {Cell cell = row1.getCell(cellIndex1);String cellValue1 = "";// 获取单元格的值if (cell != null) {switch (cell.getCellType()) {case STRING:cellValue1 = cell.getStringCellValue();break;case NUMERIC:if (DateUtil.isCellDateFormatted(cell)) {cellValue1 = cell.getDateCellValue().toString();} else {cellValue1 = String.valueOf(cell.getNumericCellValue());}break;case BOOLEAN:cellValue1 = String.valueOf(cell.getBooleanCellValue());break;case FORMULA:cellValue1 = cell.getCellFormula();break;default:cellValue1 = "";}}// 写入单元格String cellTag1 = "th"; // 第一行作为表头result += " <" + cellTag1 + ">" + escapeHtml(cellValue1) + "</" + cellTag1 + ">\n";}// 遍历工作表中的指定的行beginrow到endrowfor (int rowIndex = Integer.parseInt(beginrow); rowIndex <= Integer.parseInt(endrow); rowIndex++) {Row row = sheet.getRow(rowIndex);if (row == null) {continue;}// 写入行开始标签result += " <tr>\n";// 获取当前行的最大列数int lastCellNum = row.getLastCellNum();if (lastCellNum < 0) {lastCellNum = 0;}// 遍历行中的所有单元格for (int cellIndex = 0; cellIndex < lastCellNum; cellIndex++) {Cell cell = row.getCell(cellIndex);String cellValue = "";// 获取单元格的值if (cell != null) {switch (cell.getCellType()) {case STRING:cellValue = cell.getStringCellValue();break;case NUMERIC:if (DateUtil.isCellDateFormatted(cell)) {cellValue = cell.getDateCellValue().toString();} else {cellValue = String.valueOf(cell.getNumericCellValue());}break;case BOOLEAN:cellValue = String.valueOf(cell.getBooleanCellValue());break;case FORMULA:cellValue = cell.getCellFormula();break;default:cellValue = "";}// 写入单元格String cellTag = "td"; // 表格result += " <" + cellTag + ">" + escapeHtml(cellValue) + "</" + cellTag + ">\n";// 写入行结束标签}}}// 结束表格result += ("</table>\n");result += ("</body>\n");result += ("</html>\n");} finally {// 关闭资源if (workbook != null) {try {workbook.close();} catch (IOException e) {e.printStackTrace();}}if (fileInputStream != null) {try {fileInputStream.close();} catch (IOException e) {e.printStackTrace();}}}return result;}// HTML转义方法,防止XSS攻击private static String escapeHtml(String input) {if (input == null) {return "";}return input.replace("&", "&").replace("<", "<").replace(">", ">").replace("\"", """).replace("'", "'");}
}
相关文章:

JAVA批量发送邮件(含excel内容)
EmailSenderHtmlV1 是读取配置文件《批量发送邮件.xlsx》,配置sheet获取 发件人邮箱 邮箱账号 口令,发送excel数据sheet获取收件人邮箱 抄送人邮箱 邮件标题 第N行开始(N>1,N0默认表头) 第M行结束(M>1,M0默认表头) 附件文件夹…...

Linux(Ubuntu)新建文件权限继承问题
当你在一个工作目权限为777的文件下,新建一个文件的时候,就有可能发生,新建的这个文件,权限和其他文件,或者工作目录不一致的问题,我们不可能每次新建一个文件,就要 sudo chmod -R 777 /PATH 所…...

Java中的String的常用方法用法总结
1.1 String (1)声明 (2)字符串常量 存储字符串数据的容器:private final char value[] 字符串常量都存储在字符串常量池(StringTable)中 字符串常量池不允许存放两个相同的字符串常量 ÿ…...

QGIS如何打开 ARCGIS的mxd工程文件
“SLYR”是一款由著名开源组织“北路开源”开发的一套QGIS兼容和转换ARCGIS样式、工程、设置信息的插件!其主要功能为: 最近项目需要,我使用了一些功能,发现其对中文环境及中文信息支持不太好,还有一些其它BUG…...

基于微信小程序的智能问卷调查系统设计与实现(源码+定制+解答)基于微信生态的问卷管理与数据分析系统设计
博主介绍: ✌我是阿龙,一名专注于Java技术领域的程序员,全网拥有10W粉丝。作为CSDN特邀作者、博客专家、新星计划导师,我在计算机毕业设计开发方面积累了丰富的经验。同时,我也是掘金、华为云、阿里云、InfoQ等平台…...

React 如何封装一个可复用的 Ant Design 组件
文章目录 前言一、为什么需要封装组件?二、 仿antd组件的Button按钮三、封装一个可复用的表格组件 (实战)1. 明确需求2. 设计组件 API3. 实现组件代码4. 使用组件 三、封装组件的最佳实践四、进阶优化 总结 前言 作为一名前端开发工程师,在日常项目中&a…...
CloudWeGo-Netpoll:高性能NIO网络库浅析
一、Netpoll 简介 Netpoll 是由字节跳动开发的高性能 NIO(Non-blocking I/O)网络库,专注于 RPC 场景。在 RPC 场景中,通常有较重的处理逻辑,无法串行处理 I/O。而 Go 的标准库 net 设计了 BIO(Blocking I/…...
Mac的显卡架构种类
目录 一、Intel架构时期的Mac显卡(2006 年至 2020 年) 1. Intel 集成显卡(iGPU) 2. 独立显卡(dGPU)—— AMD 和 NVIDIA (1)AMD Radeon(主流独显选择) &a…...
HTTP基本概述
HTTP基本概述 报文格式 HTTP报文分为 请求报文 和 响应报文 一、请求报文 请求行(Request Line)请求头部(Request Headers)(空行)请求体(Request Body) ← 可选,如 P…...

Canvas SVG BpmnJS编辑器中Canvas与SVG职能详解
Canvas详解与常见API 一、Canvas基础 核心特性 • 像素级绘图:Canvas是基于位图的绘图技术,通过JavaScript操作像素实现图形渲染,适合动态、高性能场景(如游戏、数据可视化)。 • 即时模式:每次绘制需手动…...

dify多实例部署,一台机器部署多个dify实例
dify多实例部署 目的 实现在一台机器上,部署多个dify的实例。比如一个部署1.2版本,一个部署1.3版本。废话没有,直接上干货。 前提 你的电脑已经部署了一个dify实例,并成功运行。比如已经部署成功0.15.3版本。 步骤如下&#…...

ML 48.机器学习之临床生存树(rpartSurv)
简介机器学习中生存树(Survival Tree)的原理详解 生存树是结合决策树与生存分析的机器学习模型,主要用于处理带有时间-事件数据(包含删失数据)的预测问题。其核心目标是:通过树状结构对数据进行递归分割&am…...

HarmonyOS 应用开发,如何引入 Golang 编译的第三方 SO 库
本指南基于笔者临时修复的 ohos_golang_go 项目fork,解决HO 应用导入 cgo编译产物时的 crash 问题。 1. 下载 ohos_golang_go git clone https://gitcode.com/deslord/ohos_golang_go.git📌 该仓库为笔者临时修复版本,修复了 CGO 编译模式下…...
Axure元件动作六:设置图片
亲爱的小伙伴,在您浏览之前,烦请关注一下,在此深表感谢!如有帮助请订阅专栏! Axure产品经理精品视频课已登录CSDN可点击学习https://edu.csdn.net/course/detail/40420 案例视频: Axure元件动作:设置图片 课程主题:设置图片 主要内容:图片悬停、鼠标按下时、选中...

一体化雷达波明渠流量计简介
一、技术定义与核心原理 一体化雷达波明渠流量计是基于微波技术的全自动流量监测设备,采用 24G K 波段平面雷达技术,通过非接触式测量方式实现对明渠、河道、排水管网等场景的水位、流速及流量监测。其核心原理是利用雷达发射高频电磁波,经水…...

Pr -- 耳机没有Pr输出的声音
问题 很久没更新视频号了,想用pr剪辑一下,结果使用Pr打开后发现耳机没有Pr输出的声音 解决方法 在编辑--首选项-音频硬件中设置音频硬件的输出为当前耳机设备...

白皮精读:2024年国家数据基础设施建设指引【附全文阅读】
《国家数据基础设施建设指引》提出建设覆盖数据采集至安全全链条的新型基础设施,目标到 2029 年形成横向联通、纵向贯通的格局,聚焦数据可信流通、算力协同、高速传输、安全保障四大功能,明确技术架构与重点方向,强调政府与市场协同,分阶段推进试点及规模化部署,为数字中…...
【信息系统项目管理师】第21章:项目管理科学基础 - 23个经典题目及详解
更多内容请见: 备考信息系统项目管理师-专栏介绍和目录 文章目录 【第1~2题】【第3题】【第4题】【第5题】【第6题】【第7题】【第8题】【第9题】【第10题】【第11题】【第12题】【第13题】【第14题】【第15题】【第16题】【第17题】【第18题】【第19题】【第20题】【第21题】…...
Mocha-Webpack 使用教程
Mocha-Webpack 使用教程 mocha-webpackmocha test runner with integrated webpack precompiler项目地址:https://gitcode.com/gh_mirrors/mo/mocha-webpack 项目介绍 Mocha-Webpack 是一个结合了 Mocha 和 Webpack 的测试工具,它允许开发者在使用 Webpack 打包的…...
AI硬件革命:OpenAI“伴侣设备”——从概念到亿级市场的生态重构
2025年5月23日,OpenAI宣布以65亿美元全股收购苹果前首席设计师Jony Ive创立的AI硬件公司io,并计划于2026年底前推出首款“AI伴侣设备”,目标出货量达1亿台。这一消息迅速成为全球AI领域的热点,标志着AI技术从云端大模型向端侧硬件…...

穿屏技巧:Mac-Windows一套鼠标键盘控制多台设备 (sharemouse6.0-Keygen)| KM-401A
文章目录 引言I sharemouse6.0介绍功能介绍关闭自动更新安装包II 安装系统对应的sharemouse软件Windowsmac版本III 知识扩展:SCP、FTP、SSH文件传输SCP配置SSH密钥免密登录FTP(File Transfer Protocal,文件传输协议)引言 基于USB进行同步键盘和鼠标事件,更流畅。 基于局域…...

【写在创作纪念日】基于SpringBoot和PostGIS的各省东西南北四至极点区县可视化
目录 前言 一、空间检索简介 1、空间表结构 2、四至空间检索 二、前后端实现 1、后端实现 2、前端集成 三、成果展示 1、东部省份 2、西部省份 3、南部省份 4、北部省份 5、中部省份 四、总结 前言 在当今数字化时代,地理信息数据的分析与可视化对于众…...
【C/C++】线程状态以及转换
文章目录 线程状态以及转换1 基本状态1.1 新建(New)1.2 就绪(Ready / Runnable)1.3 运行中(Running)1.4 阻塞/等待(Blocked / Waiting / Sleeping)1.5 挂起(Suspended&am…...
从零开始:Python语言进阶之异常处理
一、认识异常:程序运行中的“意外事件” 在编写Python程序时,即使代码语法完全正确,运行过程中也可能遭遇各种意外情况。这些意外被称为异常,它们会打断程序的正常执行流程。例如,当我们尝试打开一个不存在的文件、用0…...
关于vue彻底删除node_modules文件夹
Vue彻底删除node_modules的命令 vue的node_modules文件夹非常大,常规手段根本无法删除. 解决方法: 在node_modules文件夹所在的路径运行命令窗口,并执行下面的命令. npm install rimraf -g rimraf node_modules说明: npm install rimraf -g 该命令是安装 node…...

如何制作可以本地联网搜索的MCP,并让本地Qwen3大模型调用搜索回答用户问题?
环境: SearXNG Qwen3-32B-FP8 vllm 0.8.5 问题描述: 如何制作可以本地联网搜索的MCP,并让本地Qwen3大模型调用搜索回答用户问题? 解决方案: 一、安装searxng 1.按需新建模型相关文件夹 mkdir MCP chmod 777 /mnt/program/MCP2.配置conda源 nano ~/.condarc nano…...

服务器硬盘虚拟卷的处理
目前的情况是需要删除逻辑卷,然后再重新来弄一遍。 数据已经备份好了,所以不用担心数据会丢失。 查看服务器的具体情况 使用 vgdisplay 操作查看服务器的卷组情况: --- Volume group ---VG Name vg01System IDFormat …...

一个国债交易策略思路
该国债交易策略的核心在于通过分析历史价格数据来识别市场趋势,并在趋势确认时进行开仓操作。策略的设计思路结合了价格波动范围的计算和市场波动性的评估,旨在捕捉市场的短期趋势并控制风险。 首先,策略通过对过去5根K线的最高价和最低价进行…...
Linux常用下载资源命令
wget命令 基本用法 wget -O http://example.com/file.zip-O 参数表示将文件保存为原始文件名。 如果需要指定文件名,可以使用 -o 参数: wget -o custom_name.zip http://example.com/file.zip-P :指定下载文件的保存路径。 wget -P /path/…...
Go语言爬虫系列教程(三)HTML解析技术
第3课:HTML解析技术 在上一章中,我们使用正则表达式提取网页内容,但这种方法有局限性。对于复杂的HTML结构,我们需要使用专门的HTML解析库。下面将介绍如何在Go中解析HTML。 1. HTML DOM树结构介绍 1.1 什么是DOM DOM…...