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

使用com组件编辑word

 一个普通的窗体应用,6个button

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MsWord = Microsoft.Office.Interop.Word;
using Microsoft.Office.Interop.Word;
using System.IO;
using Spire.Doc;
using Spire.Doc.Documents;
using Spire.Doc.Fields;namespace wordcomtest
{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){}public static class common{public static MsWord.Application oWordApplic;//a reference to Wordapplicationpublic static MsWord.Document oDoc;//a reference to thedocumentpublic static string doc_file_name = Directory.GetCurrentDirectory() + @"\content.doc";}private void button1_Click(object sender, EventArgs e){try{if (File.Exists(common.doc_file_name)){File.Delete(common.doc_file_name);}common.oWordApplic = new MsWord.Application();object missing = System.Reflection.Missing.Value;}catch (Exception e2){MessageBox.Show(e2.Message);}try{ }catch (Exception e2){MessageBox.Show(e2.Message);}}private void button2_Click(object sender, EventArgs e){try{MsWord.Range curRange;object curTxt;int curSectionNum = 1;common.oDoc = common.oWordApplic.Documents.Add();common.oDoc.Activate();//Console.WriteLine(" 正在生成文档小节");object section_nextPage = MsWord.WdBreakType.wdSectionBreakNextPage;object page_break = MsWord.WdBreakType.wdPageBreak;//添加三个分节符,共四个小节for (int si = 0; si < 2; si++){common.oDoc.Paragraphs[1].Range.InsertParagraphAfter();common.oDoc.Paragraphs[1].Range.InsertBreak(ref section_nextPage);}}catch (Exception e2){MessageBox.Show(e2.Message);}}private void button3_Click(object sender, EventArgs e){try{int curSectionNum = 1;var curRange = common.oDoc.Sections[curSectionNum].Range.Paragraphs[1].Range;curRange.Select();string one_str, key_word;//摘要的文本来自 abstract.txt 文本文件StreamReader file_abstract = new StreamReader("abstract.txt");common.oWordApplic.Options.Overtype = false;//overtype 改写模式MsWord.Selection currentSelection = common.oWordApplic.Selection;if (currentSelection.Type == MsWord.WdSelectionType.wdSelectionNormal){one_str = file_abstract.ReadLine();//读入题目currentSelection.TypeText(one_str);currentSelection.TypeParagraph(); //添加段落标记currentSelection.TypeText(" 摘要");//写入" 摘要" 二字currentSelection.TypeParagraph(); //添加段落标记key_word = file_abstract.ReadLine();//读入题目one_str = file_abstract.ReadLine();//读入段落文本while (one_str != null){currentSelection.TypeText(one_str);currentSelection.TypeParagraph(); //添加段落标记one_str = file_abstract.ReadLine();}currentSelection.TypeText(" 关键字:");currentSelection.TypeText(key_word);currentSelection.TypeParagraph(); //添加段落标记}file_abstract.Close();}catch (Exception e2){MessageBox.Show(e2.Message);}}private void button4_Click(object sender, EventArgs e){try{int curSectionNum = 3;common.oDoc.Sections[curSectionNum].Range.Paragraphs[1].Range.Select();Range curRange = common.oDoc.Sections[curSectionNum].Range.Paragraphs[1].Range;Console.WriteLine(" 正在设置标题样式");object wdFontSizeIndex;wdFontSizeIndex = 14;//此序号在 word 中的编号是格式 > 显示格式 > 样式和格式 > 显示//14 即是标题一一级标题:三号黑体。common.oWordApplic.ActiveDocument.Styles.get_Item(ref wdFontSizeIndex).ParagraphFormat.Alignment =MsWord.WdParagraphAlignment.wdAlignParagraphCenter;common.oWordApplic.ActiveDocument.Styles.get_Item(ref wdFontSizeIndex).Font.Name = " 黑体";common.oWordApplic.ActiveDocument.Styles.get_Item(ref wdFontSizeIndex).Font.Size = 16;//三号wdFontSizeIndex = 15;//15 即是标题二二级标题:小三号黑体。common.oWordApplic.ActiveDocument.Styles.get_Item(ref wdFontSizeIndex).Font.Name = " 黑体";common.oWordApplic.ActiveDocument.Styles.get_Item(ref wdFontSizeIndex).Font.Size = 15;//小三//用指定的标题来设定文本格式object Style1 = MsWord.WdBuiltinStyle.wdStyleHeading1;//一级标题:三号黑体。object Style2 = MsWord.WdBuiltinStyle.wdStyleHeading2;//二级标题:小三号黑体。common.oDoc.Sections[curSectionNum].Range.Select();var currentSelection = common.oWordApplic.Selection;//读入第一章文本信息StreamReader file_content = new StreamReader("content.txt");var one_str = file_content.ReadLine();//一级标题currentSelection.TypeText(one_str);currentSelection.TypeParagraph(); //添加段落标记one_str = file_content.ReadLine();//二级标题currentSelection.TypeText(one_str);currentSelection.TypeParagraph(); //添加段落标记one_str = file_content.ReadLine();//正文while (one_str != null){currentSelection.TypeText(one_str);currentSelection.TypeParagraph(); //添加段落标记one_str = file_content.ReadLine();//正文}file_content.Close();//段落的对齐方式curRange = common.oDoc.Sections[curSectionNum].Range.Paragraphs[1].Range;curRange.set_Style(ref Style1);common.oDoc.Sections[curSectionNum].Range.Paragraphs[1].Alignment =MsWord.WdParagraphAlignment.wdAlignParagraphCenter;curRange = common.oDoc.Sections[curSectionNum].Range.Paragraphs[2].Range;curRange.set_Style(ref Style2);//第一章正文文本格式for (int i = 3; i < common.oDoc.Sections[curSectionNum].Range.Paragraphs.Count; i++){curRange = common.oDoc.Sections[curSectionNum].Range.Paragraphs[i].Range;curRange.Select();curRange.Font.Name = " 宋体";curRange.Font.Size = 12;common.oDoc.Sections[curSectionNum].Range.Paragraphs[i].LineSpacingRule =MsWord.WdLineSpacing.wdLineSpaceMultiple;//多倍行距,1.25 倍,这里的浮点值是以 point 为单位的,不是行距的倍数common.oDoc.Sections[curSectionNum].Range.Paragraphs[i].LineSpacing = 15f;common.oDoc.Sections[curSectionNum].Range.Paragraphs[i].IndentFirstLineCharWidth(2);}}catch (Exception e2){MessageBox.Show(e2.Message);}}private void button5_Click(object sender, EventArgs e){try{object missing = System.Reflection.Missing.Value;//设置页脚 section 1 摘要int curSectionNum = 1;common.oDoc.Sections[curSectionNum].Range.Select();//进入页脚视图common.oWordApplic.ActiveWindow.ActivePane.View.SeekView =MsWord.WdSeekView.wdSeekCurrentPageFooter;common.oDoc.Sections[curSectionNum].Headers[MsWord.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Borders[MsWord.WdBorderType.wdBorderBottom].LineStyle =MsWord.WdLineStyle.wdLineStyleNone;common.oWordApplic.Selection.HeaderFooter.PageNumbers.RestartNumberingAtSection = true;common.oWordApplic.Selection.HeaderFooter.PageNumbers.NumberStyle= MsWord.WdPageNumberStyle.wdPageNumberStyleUppercaseRoman;common.oWordApplic.Selection.HeaderFooter.PageNumbers.StartingNumber = 1;//切换到文档common.oWordApplic.ActiveWindow.ActivePane.View.SeekView =MsWord.WdSeekView.wdSeekMainDocument;//Console.WriteLine(" 正在设置第二节目录页眉内容");//设置页脚 section 2 目录curSectionNum = 2;common.oDoc.Sections[curSectionNum].Range.Select();//进入页脚视图common.oWordApplic.ActiveWindow.ActivePane.View.SeekView =MsWord.WdSeekView.wdSeekCurrentPageFooter;common.oDoc.Sections[curSectionNum].Headers[MsWord.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Borders[MsWord.WdBorderType.wdBorderBottom].LineStyle =MsWord.WdLineStyle.wdLineStyleNone;common.oWordApplic.Selection.HeaderFooter.PageNumbers.RestartNumberingAtSection = false;common.oWordApplic.Selection.HeaderFooter.PageNumbers.NumberStyle= MsWord.WdPageNumberStyle.wdPageNumberStyleUppercaseRoman;//oWordApplic.Selection.HeaderFooter.PageNumbers.StartingNumber = 1;//切换到文档common.oWordApplic.ActiveWindow.ActivePane.View.SeekView =MsWord.WdSeekView.wdSeekMainDocument;//第一章页眉页码设置curSectionNum = 3;common.oDoc.Sections[curSectionNum].Range.Select();//切换入页脚视图common.oWordApplic.ActiveWindow.ActivePane.View.SeekView =MsWord.WdSeekView.wdSeekCurrentPageFooter;var currentSelection = common.oWordApplic.Selection;var curRange = currentSelection.Range;//本节页码不续上节common.oWordApplic.Selection.HeaderFooter.PageNumbers.RestartNumberingAtSection = true;//页码格式为阿拉伯common.oWordApplic.Selection.HeaderFooter.PageNumbers.NumberStyle= MsWord.WdPageNumberStyle.wdPageNumberStyleArabic;//起如页码为 1common.oWordApplic.Selection.HeaderFooter.PageNumbers.StartingNumber = 1;//添加页码域object fieldpage = MsWord.WdFieldType.wdFieldPage;common.oWordApplic.Selection.Fields.Add(common.oWordApplic.Selection.Range,ref fieldpage, ref missing, ref missing);//居中对齐common.oWordApplic.Selection.ParagraphFormat.Alignment =MsWord.WdParagraphAlignment.wdAlignParagraphCenter;//本小节不链接到上一节common.oDoc.Sections[curSectionNum].Headers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].LinkToPrevious = false;//切换入正文视图common.oWordApplic.ActiveWindow.ActivePane.View.SeekView =MsWord.WdSeekView.wdSeekMainDocument;}catch (Exception e2){MessageBox.Show(e2.Message);}}private void button6_Click(object sender, EventArgs e){try{//common.oDoc.Fields[1].Update();//保存文档//Console.WriteLine(" 正在保存 Word 文档");//string doc_file_name = Directory.GetCurrentDirectory() + @"\content.doc";object fileName;fileName = common.doc_file_name;common.oDoc.SaveAs(ref fileName);common.oDoc.Close();//释放 COM 资源System.Runtime.InteropServices.Marshal.ReleaseComObject(common.oDoc);common.oDoc = null;common.oWordApplic.Quit();System.Runtime.InteropServices.Marshal.ReleaseComObject(common.oWordApplic);common.oWordApplic = null;Spire.Doc.Document document = new Spire.Doc.Document(@"content.doc");Spire.Doc.Section section = document.AddSection();Spire.Doc.HeaderFooter footer = document.Sections[0].HeadersFooters.Footer;//Add text and image to the footerSpire.Doc.Documents.Paragraph paragraph = footer.AddParagraph();DocPicture footerImage = paragraph.AppendPicture(Image.FromFile("whu.png"));TextRange TR = paragraph.AppendText("Supported and Hosted by the non-profit Wikimedia Foundation.");//Format the text and imageparagraph.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Left;TR.CharacterFormat.FontName = "Calibri";TR.CharacterFormat.Bold = true;//添加一个Shape,并设置其大小和样式Spire.Doc.Documents.Paragraph paragraph1 = section.AddParagraph();ShapeObject shape = paragraph1.AppendShape(240, 60, ShapeType.TextWave);//设置shape的位置shape.VerticalPosition = 80;shape.HorizontalPosition = 100;//写入艺术字文本和设置斜体shape.WordArt.Text = "艺术字效果";shape.WordArt.Italic = true;//设置文字填充样式shape.FillColor = System.Drawing.Color.Red;shape.StrokeColor = System.Drawing.Color.Gray;// Save the document and launch to see the outputSpire.Doc.Documents.Paragraph paragraph2 = document.Sections[0].Paragraphs[2];Spire.Doc.Fields.Footnote footnote = paragraph2.AppendFootnote(FootnoteType.Footnote);DocumentObject obj = null;for (int i = 0; i < paragraph.ChildObjects.Count; i++){obj = paragraph.ChildObjects[i];if (obj.DocumentObjectType == DocumentObjectType.TextRange){TextRange textRange = obj as TextRange;if (textRange.Text == "推箱子"){//为添加脚注的字符串设置加粗格式textRange.CharacterFormat.Bold = true;//插入脚注paragraph.ChildObjects.Insert(i + 1, footnote);break;}}}TextRange text = footnote.TextBody.AddParagraph().AppendText("推箱子是一款来自日本的古老游戏,其设计目的是训练人的逻辑思维能力。游戏场景一般是设定在空间狭小的仓库中,要求把箱子摆放到指定位置。这就要求玩家巧妙的运用有限的空间和通道,合理的安排箱子的位置和移动次序才可能完成任务。");text.CharacterFormat.FontName = "Arial Black";text.CharacterFormat.FontSize = 9;text.CharacterFormat.TextColor = Color.DarkGray;footnote.MarkerCharacterFormat.FontName = "Calibri";footnote.MarkerCharacterFormat.FontSize = 12;footnote.MarkerCharacterFormat.Bold = true;footnote.MarkerCharacterFormat.TextColor = Color.DarkGreen;document.SaveToFile("content.doc", FileFormat.Doc);//System.Diagnostics.Process.Start("text.docx");}catch (Exception e2){MessageBox.Show(e2.Message);}}}
}

添加com引用

使用菜单:项目 -- 添加引用,在 COM 标签页添加名为 "MicrosoftWord 15.0 Object Library" Word 对象互操作库
在程序代码源文件中添加命名空间支持:
using MsWord=Microsoft.Office.Interop.Word;
所有操作 Word 对象的 COM 方法调用代码必须处在在异常处理代码块中,先创建 Word
Application 对象,它是 Word 对象操作的最开始,创建此对象时 WINWORD.EXE 进程启动。
MsWord.Application oWordApplic;//a reference to Wordapplication
MsWord.Document oDoc;//a reference to thedocument
try
{
}
catch (Exception e2)
{
MessageBox.Show(e2.Message);
}
后续所有操作 Word 对象的代码都要处于 Try 语法块中。

检测到旧的 word 档后删除旧文档。

string doc_file_name = Directory.GetCurrentDirectory() + @"\content.doc";
if (File.Exists(doc_file_name))
{
File.Delete(doc_file_name);
}
oWordApplic = new MsWord.Application();
object missing = System.Reflection.Missing.Value;

创建 Word 文档的小节

分节符在 Word 文档中是用来生成小节的控制符,每小节的页眉页脚的内容,页码格式等
保持一致。本项目生成的 Word 文档要求有不同的页码格式和页眉内容,首先插入 4 个分节符获得 5 个小节,第 1 小节是摘要内容,第 2 小节是目录,第 3 小节是第一章,第 4 小节是表 格,第 5 小节是图片。第 1, 2 小节的页码是大写罗马数字,第 3 4 5 小节的页码是阿拉伯 数字,且起始页码为 1

MsWord.Range curRange;
object curTxt;
int curSectionNum = 1;
oDoc = oWordApplic.Documents.Add(ref missing, ref missing, ref missing, ref missing);
oDoc.Activate();
Console.WriteLine(" 正在生成文档小节");
object section_nextPage = MsWord.WdBreakType.wdSectionBreakNextPage;
object page_break = MsWord.WdBreakType.wdPageBreak;
//添加三个分节符,共四个小节
for (int si = 0; si < 4; si++)
{
oDoc.Paragraphs[1].Range.InsertParagraphAfter();
oDoc.Paragraphs[1].Range.InsertBreak(ref section_nextPage);}

相关文章:

使用com组件编辑word

一个普通的窗体应用&#xff0c;6个button using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; u…...

国产Euler(欧拉)系统安装docker

国产的真™难用呀 生态又差还不开源 血泪经验 解压Docker安装包。 tar zxf docker-19.03.10.tgz 将解压后目录中的文件移动到“/usr/bin”下。 cp docker/* /usr/bin配置docker.service文件。 编辑docker.service文件。 vim /usr/lib/systemd/system/docker.service添加以…...

Linux 进程控制

文章目录 进程创建进程终止进程结果wait函数waitpid函数status参数 进程替换进程替换原理进程替换函数 补充/拓展 进程创建 fork函数 #include <unistd.h>pid_t fork(void);函数返回值&#xff1a; 在父进程中&#xff0c;fork函数返回子进程的进程ID&#xff08;PID&…...

[ Linux Audio 篇 ] 音频开发入门基础知识

在短视频兴起的背景下&#xff0c;音视频开发越来越受到重视。接下来将为大家介绍音频开发者入门知识&#xff0c;帮助读者快速了解这个领域。 轻柔的音乐、程序员有节奏感的键盘声、嗡嗡的发动机、刺耳的手提钻……这些声音是如何产生的呢&#xff1f;又是如何传到我们耳中的…...

关于高校电子邮件系统开通双因素认证的经验分享-以清华大学为例

清华大学信息化技术中心 马云龙 作者简介: 马云龙,男,清华大学信息化技术中心高级工程师;Coremail管理员社区大咖嘉宾 深耕高校计算机网络/信息化/网络安全岗位20年,对大规模计算机网络及信息系统规划,开发/建设,运维有深刻体会。 目前,越来越多的高校/企业/政府机关…...

「Swift」类淘宝商品瀑布流展示

前言&#xff1a;需要做一个类似于淘宝商品页面的瀑布流展示 结构分析&#xff1a; ps&#xff1a;图片来源 思路分析&#xff1a; 该瀑布流主要还是基于UICollectionView进行展示&#xff0c;只是在cell展示的UICollectionViewFlowLayout需要进行相应调整和自定义&#xff…...

道可云会展元宇宙平台全新升级,打造3D沉浸式展会新模式

随着VR虚拟现实、人工智能、虚拟数字人等元宇宙技术的快速发展&#xff0c;各个行业正试图通过元宇宙技术寻求新的发展突破口&#xff0c;会展行业也不例外。会展作为经贸领域的重要产业形态&#xff0c;越来越多的企业和组织开始寻求通过元宇宙技术为展会赋能&#xff0c;以满…...

Ant Design Pro初始化报错

今天按照官网步骤初始化项目&#xff0c;第一次报错 fatal: unable to access https://github.com/ant-design/ant-design-pro/: SSL certificate problem: unable to get local issuer certificate 致命&#xff1a;无法访问https://github.com/ant-design/ant-design-pro/&…...

第16届中国R会议暨2023X-AGI大会开幕,和鲸科技分享ModelOps在数据科学平台中的实践与应用

11月25日&#xff0c;第 16 届中国 R 会议暨 2023 X-AGI 大会在在中国人民大学逸夫会堂拉开帷幕&#xff0c;本次会议由中国人民大学统计学院、中国人民大学应用统计科学研究中心、统计之都、原灵科技和中国商业统计学会人工智能分会&#xff08;筹&#xff09;主办&#xff0c…...

❀My学习Linux命令小记录(12)❀

目录 ❀My学习Linux命令小记录&#xff08;12&#xff09;❀ 46.arp指令 47.tcpdump指令 48.chmod指令 49.chown指令 50.bash调用脚本指令 shell介绍 shell脚本的组成部分 脚本执行方式 检查脚本语法 bash之变量 变量的种类&#xff1a;根据生效的范围不同来区分 …...

MySQL学习day05

DCL&#xff08;Data Control Language&#xff09;数据控制语言学习 作用&#xff1a;用来创建数据库用户、控制数据库的访问权限 1&#xff09;查询用户&#xff1a; use mysql; select * from user; 2&#xff09;创建用户&#xff1a; create user 用户名主机名 identifi…...

JAVA面试题7

1.Java中的ClassLoader是什么&#xff1f; 它有什么作用&#xff1f; 答案&#xff1a;ClassLoader是一种加载Java类文件的机制&#xff0c;可以从不同的来源加载类文件&#xff0c;如本地文件系统、网络等。ClassLoader可以帮助实现模块化开发和动态加载类等功能。 2.什么是J…...

好用免费的AI换脸5个工具

在当今社会的发展中&#xff0c;人工智能&#xff08;Artificial Intelligence, AI&#xff09;扮演着关键的角色&#xff0c;其应用领域不断扩展。作为AI的一个分支&#xff0c;换脸技术近年来备受欢迎。这项技术使得将一个人的面部特征迁移到另一个人的照片或视频成为可能。除…...

【Linux】公网远程访问AMH服务器管理面板

目录 1. Linux 安装AMH 面板2. 本地访问AMH 面板3. Linux安装Cpolar4. 配置AMH面板公网地址5. 远程访问AMH面板6. 固定AMH面板公网地址 AMH 是一款基于 Linux 系统的服务器管理面板&#xff0c;它提供了一系列的功能&#xff0c;包括网站管理、FTP 管理、数据库管理、DNS 管理、…...

随笔-这都是命吗

我与鹏哥、小付有个小群&#xff0c;前几天&#xff0c;鹏哥在群里发了一个图&#xff0c;是他那个城市准备扶持的高新产业&#xff0c;有元宇宙、量子信息、生物制药、人工智能什么的。 先前的时候鹏哥给我说过&#xff0c;当地准备了六百多亩地&#xff0c;准备发展高新产业…...

优化网站性能,从容谈CDN加速的部署与运维

随着互联网的迅猛发展&#xff0c;网站的性能优化成为网站运维工作中不可或缺的一环。其中&#xff0c;CDN&#xff08;Content Delivery Network&#xff09;加速技术因其在全球范围内提供快速、可靠的内容分发而备受关注。本文将从一个网站运维的角度出发&#xff0c;深入探讨…...

JavaScript-事件

事件 事件流 指的是事件完整执行过程中的流动路径 两个阶段&#xff1a; 捕获阶段&#xff1a;从大到小冒泡阶段&#xff1a;从小到大 实际开发中都是使用事件冒泡为主 事件捕获 从DOM的根元素开始取执行对应的事件&#xff08;从外到里&#xff09; document.addEventLis…...

linux的磁盘管理

Linux 提供了多种工具和技术来进行磁盘管理。下面是对 Linux 磁盘管理的详细解释&#xff1a; 磁盘和分区&#xff1a; 磁盘&#xff08;硬盘&#xff09;&#xff1a;Linux 系统中的磁盘通常是通过 SATA、SCSI、NVMe 等接口连接的物理硬盘。可以使用工具如 lsblk、fdisk、pa…...

qt-C++笔记之主线程中使用异步逻辑来处理ROS事件循环和Qt事件循环解决相互阻塞的问题

qt-C笔记之主线程中使用异步逻辑来处理ROS事件循环和Qt事件循环解决相互阻塞的问题 code review! 文章目录 qt-C笔记之主线程中使用异步逻辑来处理ROS事件循环和Qt事件循环解决相互阻塞的问题1.Qt的app.exec()详解2.ros::spin()详解3.ros::AsyncSpinner详解4.主线程中结合使用…...

【Docker】从零开始:18.使用Dockerfile构造自己的KingbaseES数据库镜像

【Docker】从零开始&#xff1a;17.使用Dockerfile构造自己的数据库镜像 新建一个自定义目录并创建Dockerfile文件上传需要的文件到自定义目录下注意docker-circle-init.sh文件内容password 内容 开始打包注意打包完成后执行 尝试用工具连接数据库 kingbase.tar.gz 包过大我就上…...

【大模型RAG】Docker 一键部署 Milvus 完整攻略

本文概要 Milvus 2.5 Stand-alone 版可通过 Docker 在几分钟内完成安装&#xff1b;只需暴露 19530&#xff08;gRPC&#xff09;与 9091&#xff08;HTTP/WebUI&#xff09;两个端口&#xff0c;即可让本地电脑通过 PyMilvus 或浏览器访问远程 Linux 服务器上的 Milvus。下面…...

全球首个30米分辨率湿地数据集(2000—2022)

数据简介 今天我们分享的数据是全球30米分辨率湿地数据集&#xff0c;包含8种湿地亚类&#xff0c;该数据以0.5X0.5的瓦片存储&#xff0c;我们整理了所有属于中国的瓦片名称与其对应省份&#xff0c;方便大家研究使用。 该数据集作为全球首个30米分辨率、覆盖2000–2022年时间…...

linux arm系统烧录

1、打开瑞芯微程序 2、按住linux arm 的 recover按键 插入电源 3、当瑞芯微检测到有设备 4、松开recover按键 5、选择升级固件 6、点击固件选择本地刷机的linux arm 镜像 7、点击升级 &#xff08;忘了有没有这步了 估计有&#xff09; 刷机程序 和 镜像 就不提供了。要刷的时…...

【Zephyr 系列 10】实战项目:打造一个蓝牙传感器终端 + 网关系统(完整架构与全栈实现)

🧠关键词:Zephyr、BLE、终端、网关、广播、连接、传感器、数据采集、低功耗、系统集成 📌目标读者:希望基于 Zephyr 构建 BLE 系统架构、实现终端与网关协作、具备产品交付能力的开发者 📊篇幅字数:约 5200 字 ✨ 项目总览 在物联网实际项目中,**“终端 + 网关”**是…...

12.找到字符串中所有字母异位词

&#x1f9e0; 题目解析 题目描述&#xff1a; 给定两个字符串 s 和 p&#xff0c;找出 s 中所有 p 的字母异位词的起始索引。 返回的答案以数组形式表示。 字母异位词定义&#xff1a; 若两个字符串包含的字符种类和出现次数完全相同&#xff0c;顺序无所谓&#xff0c;则互为…...

EtherNet/IP转DeviceNet协议网关详解

一&#xff0c;设备主要功能 疆鸿智能JH-DVN-EIP本产品是自主研发的一款EtherNet/IP从站功能的通讯网关。该产品主要功能是连接DeviceNet总线和EtherNet/IP网络&#xff0c;本网关连接到EtherNet/IP总线中做为从站使用&#xff0c;连接到DeviceNet总线中做为从站使用。 在自动…...

3403. 从盒子中找出字典序最大的字符串 I

3403. 从盒子中找出字典序最大的字符串 I 题目链接&#xff1a;3403. 从盒子中找出字典序最大的字符串 I 代码如下&#xff1a; class Solution { public:string answerString(string word, int numFriends) {if (numFriends 1) {return word;}string res;for (int i 0;i &…...

selenium学习实战【Python爬虫】

selenium学习实战【Python爬虫】 文章目录 selenium学习实战【Python爬虫】一、声明二、学习目标三、安装依赖3.1 安装selenium库3.2 安装浏览器驱动3.2.1 查看Edge版本3.2.2 驱动安装 四、代码讲解4.1 配置浏览器4.2 加载更多4.3 寻找内容4.4 完整代码 五、报告文件爬取5.1 提…...

均衡后的SNRSINR

本文主要摘自参考文献中的前两篇&#xff0c;相关文献中经常会出现MIMO检测后的SINR不过一直没有找到相关数学推到过程&#xff0c;其中文献[1]中给出了相关原理在此仅做记录。 1. 系统模型 复信道模型 n t n_t nt​ 根发送天线&#xff0c; n r n_r nr​ 根接收天线的 MIMO 系…...

IP如何挑?2025年海外专线IP如何购买?

你花了时间和预算买了IP&#xff0c;结果IP质量不佳&#xff0c;项目效率低下不说&#xff0c;还可能带来莫名的网络问题&#xff0c;是不是太闹心了&#xff1f;尤其是在面对海外专线IP时&#xff0c;到底怎么才能买到适合自己的呢&#xff1f;所以&#xff0c;挑IP绝对是个技…...