摘要:
Captured variable is disposed in the outer scope 在for循环中使用Lambda表达式时,所有Lambda表达式可能会捕获同一个变量(例如循环计数器),导致所有闭包引用的是同一个变量的最终值。 为了避免这个问题:可以在循环内部创建一个新的局部变量,并将 阅读全文
摘要:
对于读锁:获取读锁后、其他线程可再获取读锁、但其他线程不能获取写锁(直到所有读锁释放) 如下代码示例: using System; using System.Threading; namespace ReaderWriterDemo { internal class Program { static 阅读全文
摘要:
大小端 内存地址的排列方式是从小到大的;使用VisualStudio新建main.c,键入以下代码: #include <stdio.h> int main() { //查看变量a的存储方式 //使用十六进制表示法声明一个变量a int a = 0x1234; printf("a address i 阅读全文
摘要:
参考: C# Pdf转图片通过(PdfiumViewer或O2S.Components.PDFRender4NET)实现 C# PDF转图片(JPG,Png) 实现: using PdfiumViewer; using System.Collections.Generic; using System 阅读全文
摘要:
功能A:开启一个定时器,定时间隔到达后,执行一次后停用这个定时器。 功能A能够重复使用。 using System; namespace DelayActionDemo { public class TimeInvokeMethod : IDisposable { private int _time 阅读全文
摘要:
在做窗口的hook功能时,收到消息后却不知道msg的值对应的是什么类型的消息,十分尴尬,上网速查后发现两个网址有详细介绍; public class WindowsMessage { public const int WM_NULL = 0x0000; // public const int WM_ 阅读全文
摘要:
针对handycontrol进行改造: using System; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using HandyControl.Data; using Hand 阅读全文