摘要:
public class OptionServices { //安装服务 public static void InstallService(string filepath, string serviceName, string[] options) { try { if (!IsServiceEx... 阅读全文
摘要:
摘自:http://www.cnblogs.com/tom-tong/archive/2012/03/12/2392173.html public static int GetOSBit() { ... 阅读全文
摘要:
原文地址:http://www.cnblogs.com/feishu/archive/2010/05/08/1730797.html1234567891011121314usingSystem.Runtime.InteropServices; [DllImport("User32.dll", CharSet = CharSet.Auto)] publicstaticexternintGetWindowThreadProcessId(IntPtr hwnd, outintID); protectedvoidButton1_Click(objectsender, EventAr 阅读全文
摘要:
利用.Net中Process类调用netstat命令来判断计算端口的使用情况:Processp=newProcess();p.StartInfo=newProcessStartInfo("netstat","-a");p.StartInfo.CreateNoWindow=true;p.StartInfo.UseShellExecute=false;p.StartInfo.WindowStyle=ProcessWindowStyle.Hidden;p.StartInfo.RedirectStandardOutput=true;p.Start();strin 阅读全文