using System;
|
using System.Collections.Generic;
|
using System.Windows.Forms;
|
using Pub_Class;
|
|
namespace MES
|
{
|
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("发现最新版本,需要更新\r\n");
|
//得到更新表
|
string sTableName = ClsIni.ReadIni("UpDateCounts", "sTableName", ClsPub.AppPath + @"\" + "UpDatePrj.ini");
|
if (sTableName == "没有找到!" || sTableName == "" || sTableName == "HX_Update")
|
{
|
string strFileName = DBUtility.ClsPub.AppPath + @"\HX_Update.exe";
|
System.Diagnostics.Process.Start(strFileName);
|
Application.Exit();
|
return;
|
}
|
else if (sTableName == "HX_UpdateFor64")
|
{
|
string strFileName = DBUtility.ClsPub.AppPath + @"\HX_UpdateFor64.exe";
|
System.Diagnostics.Process.Start(strFileName);
|
Application.Exit();
|
return;
|
}
|
else
|
{
|
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)
|
{
|
//System.IO.File.Delete(DBUtility.ClsPub.AppPath + @"\HX_Load.exe");
|
frmParent MainFrm = new frmParent();
|
Application.Run(MainFrm);
|
}
|
}
|
}
|
}
|
}
|