zoukankan      html  css  js  c++  java
  • 2012-2-7列举及终止进程

    System.Diagnostics.Process[] ps = System.Diagnostics.Process.GetProcessesByName("MSACCESS");

                while (ps.Length > 0)          {                 ps[0].Kill();

                     System.Threading.Thread.Sleep(20);

                     ps = System.Diagnostics.Process.GetProcessesByName("MSACCESS");

                 } /////////////             string tempName = "";

                 int begpos;

                 int endpos;

                 foreach (System.Diagnostics.Process thisProc in System.Diagnostics.Process.GetProcesses())             {                 tempName = thisProc.ToString();

                     begpos = tempName.IndexOf("(") + 1;

                     endpos = tempName.IndexOf(")");

                     tempName = tempName.Substring(begpos, endpos - begpos);

                    if (tempName == "MSACCESS")

                     {

                         thisProc.Kill();//当发送关闭窗口命令无效时强行结束进程

                         while (!thisProc.HasExited) System.Threading.Thread.Sleep(10);

                         System.Threading.Thread.Sleep(100);

                     }

                 }

  • 相关阅读:
    display
    盒子模型
    css样式
    修改页面标题前的图标
    form表单
    html中列表
    代码书写格式
    dw中的超链接
    硬盘的访问,程序重定位和加载
    Bochs调试指令
  • 原文地址:https://www.cnblogs.com/mol1995/p/5965082.html
Copyright © 2011-2022 走看看