CZ_Power/Program.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;
using DevComponents.DotNetBar;
using System.Configuration;

namespace CZ_Power
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main(string[] cmd)
        {
            //初始化日志文件 
            string state = ConfigurationManager.AppSettings["IsWriteLog"];
            //判断是否开启日志记录
            if (state == "1")
            {
                var path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase +
                           ConfigurationManager.AppSettings["log4net"];
                var fi = new System.IO.FileInfo(path);
                log4net.Config.XmlConfigurator.Configure(fi);
            }

            //LogHelper.WriteLog("holle world");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (cmd.Length > 0)
            {
                if (cmd[0] == "/wait" && cmd.Length >= 2)
                {
                    try
                    {
                        System.Diagnostics.Process p = System.Diagnostics.Process.GetProcessById(int.Parse(cmd[1]));
                        if (p != null) p.WaitForExit();	//等待终止
                    }
                    catch (Exception) { }
                }
                MyApplicationContent appContent = new MyApplicationContent(new FormMenu(), new FormStartUP());
                Application.Run(appContent);
            }
            else
            {
                bool bCreateNew = false;
                #region 互斥体
                using (Mutex mutext = new Mutex(true, "CZ_Power", out bCreateNew))
                {
                    if (bCreateNew)
                    {
                        MyApplicationContent appContent = new MyApplicationContent(new FormMenu(), new FormStartUP());
                        Application.Run(appContent);
                    }
                    else
                    {
后面还有 91 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。