随笔分类 - C#
摘要:修改项目的csproj文件 <PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net6.0-windows</TargetFramework> <Nullable>enable</Nullable> <UseWPF>tr
阅读全文
摘要:官方网站 https://fontawesome.com/ ##########下载 下载地址:https://fontawesome.com/download 下载内容:Free For Web ##########使用 双击**.ttf,进入安装页可以看到“字体名称……”,记住字体名称 将 **
阅读全文
摘要:使用Microsoft.Office.Interop.Word操作Word using System; using System.Collections.Generic; using Word = Microsoft.Office.Interop.Word; namespace Com.FTools
阅读全文
摘要:工程说明 一、Com.FToolsforExcel.Progress项目 包含 进度窗口类ProgressWindow,用于展示进度; 委托类ProgressChangedEventHandler,参数是自定义的ProgressChangedEventArgs(进度消息参数)类型; 进度消息类Pro
阅读全文
摘要:有Windows资源管理器中文件名如下: 1你好.txt 、2你好.txt、11你好.txt 使用C# DirectoryInfo.GetFiles获得FileInfo[]信息的排序会是如下情况: 1你好.txt 、11你好.txt、2你好.txt 这不符合我们的使用习惯,可以借助Windows的A
阅读全文
摘要:安装与使用 工具是一个ExcelDNA的 xll 加载项,如下图,32位Excel装前者,64位装后者。 64位Excel加载如图(还可以配合ExcelDNA的函数参数提示支持xll,这里不做说明) 在【公式】—【函数】可以找到IDCardFuns类下的IDNumCheck函数,用法是=IDNumC
阅读全文
摘要:object[,] records = worksheet.Range["A1:E"+ endRowIndex].Value2; worksheet.Range["A1"].Resize[endRowIndex, 5].Value = records;
阅读全文
摘要:在VSTO、ExcelDna的开发方式中,提供了非常容易的实现方法,而在Com开发下则必须自己实现,具体的方法就在下面的博主抄来的内容里。 编译dll的时候注意选择32/64位 以下内容除空格外都是从 DAVID E. CRAIG 这哥们儿的博客抄来的: CustomTaskPanes in a .
阅读全文
摘要:public class ExcelOledbHelper { private readonly string connectionStr; /// <summary> /// /// </summary> /// <param name="pathOfExcel">path of Excel, e
阅读全文
摘要:1 public class SqliteHelper 2 { 3 private readonly string connectionStr; 4 public SqliteHelper(string dbPath) 5 { 6 if (System.IO.File.Exists(dbPath))
阅读全文
摘要:C#写Sqlite,sqlite库从nuget获得,下载System.Data.SQLite。 连接数据库报错如下: 翻了好多博客说是C++库的问题,控制面板瞅瞅库也不少啊,试了一些也不成功。 最终把随System.Data.SQLite 一起下载的 SQLite.Interop.dll 复制到与启
阅读全文
摘要:很简单,不翻译了。 If you are using COM components on your .NET code, you might be already aware of the Marshal.ReleaseComObject and Marshal.FinalReleaseComObj
阅读全文
该文被密码保护。