Exemple #1
0
        static void Main()
        {
            LogManager.WriteLog(LogManager.LOGINFO, "Program is Starting......");
            GlobalClass.ip       = ConfigurationManager.AppSettings["ip"].ToString();
            GlobalClass.httpport = ConfigurationManager.AppSettings["httpport"].ToString();
            GlobalClass.tcpport  = ConfigurationManager.AppSettings["tcpport"].ToString();
            TCPUtil t = new TCPUtil();

            t.StartThread();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Login());
            TCPUtil.CloseConn();
        }
Exemple #2
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (ShowInTaskbar)
     {
         if (MessageBox.Show("是否确认退出程序?", "退出", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
         {
             this.Dispose();
             TCPUtil.CloseConn();
             Util.Exit();
         }
         else
         {
             e.Cancel = true;
         }
     }
 }