zoukankan      html  css  js  c++  java
  • C# 判断程序是否已经在运行

       /// <summary>
            /// 应用程序的主入口点。
            /// </summary>
            [STAThread]
            static void Main()
            {
                //获取欲启动进程名
                string strProcessName = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
                ////获取版本号
                //CommonData.VersionNumber = Application.ProductVersion;
                //检查进程是否已经启动,已经启动则显示报错信息退出程序。
                if (System.Diagnostics.Process.GetProcessesByName(strProcessName).Length > 1)
                {

                    MessageBox.Show("CtiAgentClient呼叫中心客户端已经运行!", "消息", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    Application.Exit();
                    return;
                }

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new frmMain());
            }

  • 相关阅读:
    storm学习途径
    Spark中的RDD操作简介
    【转】Hadoop web页面的授权设定
    源码安装ipython,并在ipython中整合spark
    Spark调优
    在Java中调用C
    查看Mysql表空间大小 优化空间
    update A inner join
    kibana 汉化
    xcode-select --install不能下载该软件的解决办法
  • 原文地址:https://www.cnblogs.com/hailexuexi/p/2004850.html
Copyright © 2011-2022 走看看