华恒Mes鼎捷代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.0 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.IO;
namespace ICSSoft.AutoUpdate.Edition.DownLoad
{
static class Program
{
public static System.Threading.Mutex Run;
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
bool noRun = false;
Run = new System.Threading.Mutex(true, Application.ProductName, out noRun);
//if (!noRun)
{
MessageBox.Show("本程序已经启动,无法再次启动");
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Run.ReleaseMutex();
string WebUrl = "";
DevExpress.Utils.WaitDialogForm _wait = new DevExpress.Utils.WaitDialogForm("正在加载更新文件中...请稍等....");
_wait.Show();
if (!Directory.Exists(Application.StartupPath + "\\BaseServiceConfig"))
{
Directory.CreateDirectory(Application.StartupPath + "\\BaseServiceConfig");
}
if (!File.Exists(Application.StartupPath + "\\BaseServiceConfig\\baseserviceurl.ini"))
{
using (File.Create(Application.StartupPath + "\\BaseServiceConfig\\baseserviceurl.ini"))
{
}
}
using (StreamReader sr = new StreamReader(Application.StartupPath + "\\BaseServiceConfig\\baseserviceurl.ini"))
{
while (sr.Peek() > -1)
{
string value = sr.ReadLine();
if (!string.IsNullOrEmpty(value))
{
WebUrl = value;
}
}
}
_wait.Close();
if (WebUrl.Trim() != "")
{
Application.Run(new FormAutoUpdate(WebUrl));
}
}
}
}