C#操作系统控制
hcqi2004
这个作者很懒,什么都没留下…
展开
-
C# 强制关闭当前程序进程
函数:/// /// 运行DOS命令 /// DOS关闭进程命令(ntsd -c q -p PID )PID为进程的ID /// /// /// public static string RunCmd(string command) { //实例一个Process类,启动一个独立进程 System.Diagnostics.Process p = ne转载 2011-12-28 10:41:01 · 1527 阅读 · 0 评论 -
C#获取当前系统时间
--DateTime 数字型System.DateTime currentTime=new System.DateTime(); 取当前年月日时分秒 currentTime=System.DateTime.Now; 取当前年 int 年=currentTime.Year; 取当前月 int 月=currentTime.Month; 取当前日转载 2011-12-28 17:16:58 · 544 阅读 · 0 评论 -
获取cpu序列号,硬盘ID,网卡MAC地址
首先在添加引用中选中System.Management 再在开始部门: using System.Management; using System.Management.Instrumentation; private void GetInfo() { string cpuInfo = "";//cpu序列号 ManagementClass转载 2012-02-07 12:13:40 · 684 阅读 · 0 评论