随笔分类 -  C#

摘要:public static List<string> GetMacByWMI() { List<string> macs =new List<string>(); try { string mac =""; ManagementClass mc =new ManagementClass("Win32 阅读全文
posted @ 2023-03-23 15:33 qq921201008 阅读(19) 评论(0) 推荐(0) 编辑
摘要:在c#中退出WinForm程序包括有很多方法,如:this.Close(); Application.Exit();Application.ExitThread(); System.Environment.Exit(0); 等他们各自的方法不一样,下面我们就来详细介绍一下。 1.this.Close 阅读全文
posted @ 2016-12-28 16:50 qq921201008 阅读(402) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace 计时器 ... 阅读全文
posted @ 2016-04-12 17:18 qq921201008 阅读(673) 评论(0) 推荐(0) 编辑
摘要://二进制读 //十进制 阅读全文
posted @ 2016-04-08 16:31 qq921201008 阅读(373) 评论(0) 推荐(0) 编辑
摘要://检测硬件改变 protected override void WndProc(ref Message m) { const int WM_DEVICECHANGE = 0x219; if (m.Msg == WM_DEVICECHANGE) { if... 阅读全文
posted @ 2016-04-08 14:17 qq921201008 阅读(441) 评论(0) 推荐(0) 编辑
摘要:自动保存路径到配置文件 阅读全文
posted @ 2016-04-08 14:16 qq921201008 阅读(761) 评论(0) 推荐(0) 编辑
摘要:1.在Form1类中添加以下代码 private delegate void UpdateStatusDelegate(string status); private void UpdateStatus(string status) { this.t... 阅读全文
posted @ 2015-01-03 16:46 qq921201008 阅读(268) 评论(0) 推荐(0) 编辑
摘要:1. 项目右键--属性---生成--允许不安全代码2.在代码中加入unsafe关键字[DllImport("DLL.dll")] unsafe public static extern bool UsbWrite(char* WriteBuffer, int size); ... 阅读全文
posted @ 2015-01-03 15:24 qq921201008 阅读(216) 评论(0) 推荐(0) 编辑
摘要:1.将DLL复制到工程下 2.添加如下代码 阅读全文
posted @ 2015-01-03 01:18 qq921201008 阅读(179) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Drawing;using System.Windows.Forms;using System.Runtime.InteropServices;namespace test{ public partial class Form1 : Form... 阅读全文
posted @ 2014-06-29 00:20 qq921201008 阅读(406) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示