随笔分类 -  WinForm

C#得到CPU的序列号、硬盘序列号、网卡序列号
摘要://得到cpu信息 public static void GetCpuIndex() { string _cpuInfo = ""; ManagementClass cimobject = new ManagementClass("Win32_Processor"); ManagementObjectCollection ... 阅读全文

posted @ 2008-10-23 16:33 谢杰 阅读(1376) 评论(0) 推荐(0)

常用帮助
摘要:1、Window Form: 获取当前路径:Application.StartupPath 2、控制台程序获得当前路径: System.Environment.CurrentDirectory 3、查询某个具体的xml节点: string xPath = "节点名称[@属性名称(字符型)='"+ 值 +"' and @属性名称(int型)="+ 值 +"]" 4、sql 2005的row_num... 阅读全文

posted @ 2008-08-07 12:34 谢杰 阅读(294) 评论(0) 推荐(0)

c#自动关机代码
摘要:public class ShutDown { [StructLayout(LayoutKind.Sequential, Pack = 1)] internal struct TokPriv1Luid { public int Count; public long Luid; ... 阅读全文

posted @ 2008-07-24 20:51 谢杰 阅读(4714) 评论(0) 推荐(0)

用委托与事件的方法创建菜单
摘要:namespace WindowsFormsApplication8 { // 定义一个委托 public delegate void ItemClick(string dllAndFormName); public partial class Form1 : Form { public Form1() { I... 阅读全文

posted @ 2008-07-15 17:51 谢杰 阅读(323) 评论(0) 推荐(0)