Ejemplo n.º 1
0
        /// <summary>
        /// 验证密码
        /// </summary>
        public void checkPwd(Object sender, EventArgs e)
        {
            if (tbxPwd.Text.Trim().Length == 0)
            {
                lblMsg.Text = "请输入密码";
                return;
            }
            else
            {
                string md5 = new FnString().toMD5(tbxPwd.Text.Trim());

                string expPasword = "";

                switch (source)
                {
                case FormConfig.SOURCE_1:
                    expPasword = config2.password;
                    if (md5.Equals(expPasword))
                    {
                        formConfig.accessOK();
                        this.Close();
                    }
                    else
                    {
                        lblMsg.Text = "密码错误";
                    }

                    break;

                case FormConfig.SOURCE_2:
                    expPasword = config2.password2;
                    if (md5.Equals(expPasword))
                    {
                        formConfig.accessOK();
                        this.Close();
                    }
                    else
                    {
                        lblMsg.Text = "密码错误";
                    }

                    break;
                }
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] strArgs)
        {
            // 프로세스 아규먼트 처리
            if (strArgs.Length <= 0)
            {
                MessageBox.Show("PSO실행시, 프로세스 일련번호가 입력되지 않았습니다",
                                "PSO 실행 오류",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }
            if (!FnString.IsNumber(strArgs[0]))
            {
                MessageBox.Show(string.Format("PSO 실행시,  프로세스 일련번호 ({0}) 가 숫자로 입력되지 않았습니다", strArgs[0]),
                                "PSO 실행 오류",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }
            Config.PROCESS_NO = Convert.ToInt32(strArgs[0]);

            //// 환경 파일 로딩 ////
            string iniFile = string.Format("{0}\\..\\Btfax.ini", Application.StartupPath);

            if (!Config.LoadIni(iniFile))
            {
                MessageBox.Show(string.Format("환경파일({0}) 읽기 실패.", iniFile), "실행 오류", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            //// 윈폼 생성 ////
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Program.s_frmMain = new FrmMain();

            //// 초기화 ////
            AppLog.LogDefaultPath = Application.StartupPath + "\\log\\";
            AppLog.LogPrefix      = string.Format("FAX_{0}_PSO_{1}", Config.SYSTEM_NO, Config.PROCESS_NO);
            //AppLog.DisplayDelegate = Program.s_frmMain.Display_AddLog;
            //Config.DisplayDelegate = Program.s_frmMain.Display_Config;
            CommonMsgBox.IsMsgPopup = false;

            //// 프로세스 시작 ////
            Config.APP_VER = string.Format("v{0}", Assembly.GetExecutingAssembly().GetName().Version);
            AppLog.Write(LOG_LEVEL.MSG, string.Format("### PSO {0} 프로세스 시작 ###", Config.APP_VER));

            //// DB 접속 ////
            if (!DbModule.Instance.Open(Config.DB_CONNECTION_STRING))
            {
                AppLog.Write(LOG_LEVEL.ERR, "DB 접속에 실패하였습니다");
                return;
            }
            AppLog.Write(LOG_LEVEL.MSG, "DB 접속 완료");

            //// 환경 DB 로딩 ////
            if (!Config.LoadDb())
            {
                AppLog.Write(LOG_LEVEL.ERR, "환경파일 읽기를 실패하였습니다");
                return;
            }
            AppLog.LogLevel = Config.LOG_LEVEL;
            AppLog.Write(LOG_LEVEL.MSG, "실행환경 적용 완료");

            //// 쓰레드 객체 생성 ////
            s_WorkerThread = WorkerThread.Instance;

            //// UDP 소켓 초기화
            UdpSingle.Instance.InitUdpSocket(false);

            //// 윈폼 실행 ////
            try
            {
                //// 쓰레드 시작 ////
                Program.Thread_Start();
                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
                Application.ThreadException += new ThreadExceptionEventHandler(ApplicationThreadException);

                //// 쓰레드 종료 ////
                Program.Thread_Start();
                Application.Run(Program.s_frmMain);
            }
            catch (Exception ex)
            {
                //// 쓰레드 종료 ////
                Program.Thread_Start();
                AppLog.ExceptionLog(ex, "어플리케이션 예외가 발생하였습니다.");
            }

            //// 프로세스 종료 로그 기록 ////
            AppLog.Write(LOG_LEVEL.MSG, "### PSO 프로세스  종료 ###");
        }