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; /// /// 应用程序的主入口点。 /// [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)); } } } }