08 2021 档案
摘要:参考: 李志. Learning hard C#学习笔记 (图灵原创) (p. 86). 人民邮电出版社. Kindle 版本. 1 static void TestOut(out int a) 2 { 3 a = 12; //out 修饰符如果不赋值 就会导致 编译器报错 4 Console.Wr
阅读全文
摘要:参考: 李志. Learning hard C#学习笔记 (图灵原创) (p. 86). 人民邮电出版社. Kindle 版本.
阅读全文
摘要:参考: 李志. Learning hard C#学习笔记 (图灵原创) (p. 86). 人民邮电出版社. Kindle 版本. 值 类型 通常 被 分配 到 线程 的 堆栈 上, 而 引用 类型 则 被 分配 到 托管 堆 上。 不同 的 分配 位置 导致 了 不同的 管理 机制, 值 类型 的
阅读全文
摘要:1 using System; 2 using System.Reflection; 3 4 namespace ConsoleApp1 5 { 6 class Program 7 { 8 // 自定义委托 9 public delegate void TestHandler(string msg)
阅读全文
摘要:C# 委托类似于C函数指针示例使用: 1 using System; 2 using System.Reflection; 3 4 namespace ConsoleApp7 5 { 6 class Program 7 { 8 delegate void PrintHello(); 9 10 sta
阅读全文
摘要:参考:文档API生成神器SandCastle使用心得 - edisoner - 博客园 (cnblogs.com) 下载 :SHFBInstaller_v2021.4.9.0
阅读全文
摘要:测试线程同步机制 AutoResetEvent: 1 static AutoResetEvent wakeup = new AutoResetEvent(false); 2 static void pthread_func() 3 { 4 while (true) 5 { 6 7 Console.W
阅读全文
摘要:今天测试程序发现一个比较有意思的事,如下代码: static void Main(string[] args) { List<byte> ts = new List<byte>() { 0x00, 0x01}; int aa = (int)ts[0] << 8 + (int)ts[1]; int b
阅读全文
摘要:今天测试程序发现一个比较有意思的事,如下代码: static void Main(string[] args) { List<byte> ts = new List<byte>() { 0x00, 0x01}; int aa = (int)ts[0] << 8 + (int)ts[1]; int b
阅读全文
摘要:在类定义中导入如下声明语句,可以直接在类方法中使用该函数。 [DllImport("kernel32")] extern static UInt64 GetTickCount64();
阅读全文
摘要:参考官方连接: Deserialize a Dictionary (newtonsoft.com) 步骤1:vs 项目安装对应包 步骤2: 添加using 引用 using Newtonsoft.Json; 完整程序 程序代码: 1 using System; 2 using System.Coll
阅读全文
摘要:每个页面之前(如下) 不能够创建新class 否则会导致 VS 设计器不能正常显示 public partial class XXXForm : Form
阅读全文
摘要:图片资源有两个地方,一个是全局的在Properties下的Resources.resx文件,另一个是在专属于某窗体使用的图片资源,位置在窗体下的resx文件中。 从工具箱中拖入pictureBox 到设计窗口,然后在设计窗口右击选择图像继续导入到指定的图像到本窗口资源文件就行。
阅读全文