zoukankan      html  css  js  c++  java
  • VS.NET在程序中关闭其他运行的程序

    System.Diagnostics.Process myproc = new System.Diagnostics.Process();
            //得到所有打开的进程
            try
            {
                foreach (System.Diagnostics.Process thisproc in System.Diagnostics.Process.GetProcessesByName(processName))
                {
                    if (!thisproc.CloseMainWindow())
                    {
                        if (thisproc != null)
                            thisproc.Kill();
                    }
                }
            }

            catch (Exception Exc)
            {
                throw Exc;
            }

  • 相关阅读:
    单词接龙
    字符串,字符数组
    马的遍历
    约瑟夫问题
    扫雷游戏
    寻找道路
    传纸条
    数的划分
    火柴棒等式
    火星人
  • 原文地址:https://www.cnblogs.com/vic_lu/p/1810067.html
Copyright © 2011-2022 走看看