forever流浪

导航

 

  private void KillProcess(string processName)
        {
            System.Diagnostics.Process myproc = new System.Diagnostics.Process();
            //得到所有打开的进程
            try
            {
                foreach (Process thisproc in Process.GetProcessesByName("WINPROJ"))
                {
                    if (!thisproc.CloseMainWindow())
                    {
                        thisproc.Kill();
                    }
                }
            }
            catch (System.Exception ex )
            {
                ScriptManager.RegisterStartupScript(this.btnUpload, GetType(), "dis", "alert('进程杀死失败');", true);
            }
        }

posted on 2010-05-27 15:39  forever流浪  阅读(1075)  评论(0)    收藏  举报