09 2013 档案
摘要:原文:http://blog.csdn.net/vchao13/article/details/62002551、获取指定目录下所有文件信息//////返回指定目录下所有文件信息//////目录字符串///publicListGetAllFilesInDirectory(stringstrDirectory){ListlistFiles=newList();//保存所有的文件信息DirectoryInfodirectory=newDirectoryInfo(strDirectory);DirectoryInfo[]directoryArray=directory.GetDirectories(
阅读全文
摘要: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
阅读全文