c# 查找进程

System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("vvv");//模糊查找进程
                foreach (System.Diagnostics.Process p in processes)
                {
                    if (System.IO.Path.Combine(Application.StartupPath, "VTexe\\vvv.exe") == p.MainModule.FileName)//比较完整路径
                    {
                        p.Kill();
                        p.Close();
                    }
                }

posted @ 2015-05-18 10:28  小小戒  阅读(1540)  评论(0编辑  收藏  举报