代码杂记32

C#中下载一个网络上的文件

            string url = "http://60.210.16.252/ifox/TGogoESUTGodTmk9JESuJfmg-LsAJ6Xl4AV-HliuS6PNs91v/SoHuVA_4.0.0.98-byd-b360-c1001-nsi-x.exe";
            WebClient myWebClient = new WebClient();
            myWebClient.DownloadFile(url, @"./down.exe");

执行exe文件

            System.Diagnostics.Process pExecuteEXE = new System.Diagnostics.Process();
            pExecuteEXE.StartInfo.FileName = "down.exe";
            pExecuteEXE.Start();
            pExecuteEXE.WaitForExit();

获取进程名,ID

            List<string> str = new List<string>();
            Process[] processes;
            processes = System.Diagnostics.Process.GetProcesses();
            foreach (Process pro in processes)
            {
                str.Add(pro.ProcessName);
            }
            str.Sort();
原文地址:https://www.cnblogs.com/7ants/p/2940540.html