随笔分类 - C#
摘要:C#多线程和异步(一)——基本概念和使用方法 - 捞月亮的猴子 - 博客园 (cnblogs.com) [C#.NET 拾遗补漏]12:死锁和活锁的发生及避免 - 精致码农 - 博客园 (cnblogs.com) C#(99):多线程锁:Mutex互斥体,Semaphore信号量,Monitor监视
阅读全文
摘要:First, add the dll to Reference and set Copy Local to False. Then create a new project folder "libs", copy the referenced dll into this folder, and se
阅读全文
摘要:private void button1_Click(object sender, EventArgs e) { Image myImage = Image.FromFile(@"D:\pic\original.jpg", true); SaveImg(@"D:\pic\reduced.jpg",
阅读全文
摘要:通过代码实现Win+D,Win+E等等,可以参考以下代码: [DllImport("User32.dll")] public static extern void keybd_event(Byte bVk, Byte bScan, Int32 dwFlags, Int32 dwExtraInfo);
阅读全文
摘要:基本用法(CRUD) 1.插入: 2.修改: 3.查询: 4.删除: 获取主键:
阅读全文
摘要:以下例子获取每个月的第四个星期五 结果:
阅读全文
摘要:// Define entity classes [Table(Name = "CAR")] public class CARclass { [Column(Name = "Id")] public int Id { get; set; } [Column(Name = "Model")] publ
阅读全文
摘要:public static DataTable OpenCSV(string filePath) { DataTable dt = new DataTable(); FileStream fs = new FileStream(filePath, System.IO.FileMode.Open, S
阅读全文
摘要:C# Code: string xmlPath = "D:\\test.xml"; XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(xmlPath); // Save namespace uri string msoUri = "http://
阅读全文
摘要:C# 利用反射动态创建对象——带参数的构造函数和String类型 C# 把类实例保存到文件里(类的序列化和反序列化) C# WinForm获取 当前执行程序路径的几种方法
阅读全文
摘要:dynamic MyDynamic = new System.Dynamic.ExpandoObject(); MyDynamic.A = "A"; MyDynamic.B = "B"; MyDynamic.C = "C"; MyDynamic.Number = 12; MyDynamic.MyMe
阅读全文
摘要:NuGet: ByteScout PDF SDK https://bytescout.com/products/developer/pdfextractorsdk/convert-pdf-to-excel-xls
阅读全文
摘要:1.使用 NuGet 安装 System.Data.SQLite 2.在 App.config 中配置连接字符串 3.简单使用
阅读全文
摘要:Download link: FFmpeg Builds
阅读全文
摘要:获取 bin 同级文件夹 assets 中的 test.html 其中 AppDomain.CurrentDomain.BaseDirectory 的值为
阅读全文
摘要:Here is the conversion code: Before using it, you need to add "DocumentUltimate" from "NuGet". The specific operation is as follows: Right click the R
阅读全文
摘要:遍历文件夹和文件 获取目录下的文件和子目录(不递归目录,支持通配符查找) 获取指定文件信息 复制文件夹下所有内容 获取文件夹大小
阅读全文
摘要:1.使用Stopwatch 2.使用DateTime 3.调用API 4.利用Thread的UserProcessorTime
阅读全文
摘要:1.Invoke 在主线程中会出现 1 秒钟的阻塞,因为 Invoke 是同步的,而不是创建新线程。 2.BeginInvoke BeginInvoke 会在新线程中执行,并且不会对主线程产生租塞,同时它可以获取自己的返回值,使用EndInvoke实现。 Delegate.BeginInvoke 方
阅读全文