jhz
2022-09-08 eb045e76eb29f6c2bb23e644561d68e535129898
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Collections.Generic;
using System.Windows.Forms;
 
namespace NETERP
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]   
        static void Main()   
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            DBUtility.ClsPub.AppPath = System.Environment.CurrentDirectory;
            Pub_Class.ClsPub.AppPath = System.Environment.CurrentDirectory;
            Pub_Class.ClsPub.SetIPAddress();
            DBUtility.ClsPub.SetIPAddress();
            DBUtility.ClsPub.VersionNum = "12.1";///
            Pub_Class.ClsPub.VersionNum = "12.1";//
            //===================================================================
            //try
            //{
                if (DBUtility.ClsPub.CheckUpdate())
                {    
                    MessageBox.Show("发现最新版本,需要更新!");
                    string strFileName = DBUtility.ClsPub.AppPath + @"\HX_Update.exe";
                    System.Diagnostics.Process.Start(strFileName);
                    Application.Exit();
                    return;   
                }
                else   
                {
                    //============================================   
                    BLL.FrmLogin frmlg = new BLL.FrmLogin();
                    frmlg.ShowDialog();
                    if (frmlg.isOk)   
                    {
                        MDIMain MainFrm = new MDIMain();
                        Application.Run(MainFrm);
                    }
                }
            //}
            //catch (Exception e)
            //{
            //    MessageBox.Show(e.Message);
            //    Application.Exit();
            //    return;
            //}
        }
    }
}