static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Process instance = RunningInstance(); if (instance == null) { #region 在线更新 try { //string _ip = Securit.DeDES(FileReadAndWrite.IniReadValue("ftpfile", "ip")); //string _id = Securit.DeDES(FileReadAndWrite.IniReadValue("ftpfile", "id")); //string _pwd = Securit.DeDES(FileReadAndWrite.IniReadValue("ftpfile", "pwd")); //FileUpDown fileUpDown = new FileUpDown(_ip, _id, _pwd); thePreUpdateDate = GetTheUpdateVersionNum(System.Windows.Forms.Application.StartupPath);//上次的版本号 //fileUpDown.Download(CommonStaticParameter.TEMP, "UpdateConfig.xml", "WorkLog"); //thePreUpdateDate = GetTheUpdateVersionNum(CommonStaticParameter.TEMP);//这次的版本号 } catch (Exception ex) { MessageBox.Show("程序出错 原因:" + ex.Message.ToString()); } #endregion string isSelfStarting = FileReadAndWrite.IniReadValue("temp", "isSelfStarting"); //Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); if (isSelfStarting == CommonStaticParameter.YES) { SetSelfStarting(); } login = new login(); login.ShowMain += login_ShowMain; login.ShowDialog(); //loginmessage = login.loginMessage; //if (login.loginMessage == "") { //} //if (login.ShowDialog() == DialogResult.OK) //{ } //Application.Run(new TimeManagement()); } else { HandleRunningInstance(instance); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); login login = new login(); if (login.ShowDialog() == DialogResult.OK) { main mainForm = new main(); mainForm.User = login.User; Application.Run(mainForm); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Process instance = RunningInstance(); if (instance == null) { #region 在线更新 try { //string _ip = Securit.DeDES(FileReadAndWrite.IniReadValue("ftpfile", "ip")); //string _id = Securit.DeDES(FileReadAndWrite.IniReadValue("ftpfile", "id")); //string _pwd = Securit.DeDES(FileReadAndWrite.IniReadValue("ftpfile", "pwd")); //FileUpDown fileUpDown = new FileUpDown(_ip, _id, _pwd); thePreUpdateDate = GetTheUpdateVersionNum(System.Windows.Forms.Application.StartupPath);//上次的版本号 //fileUpDown.Download(CommonStaticParameter.TEMP, "UpdateConfig.xml", "WorkLog"); //thePreUpdateDate = GetTheUpdateVersionNum(CommonStaticParameter.TEMP);//这次的版本号 } catch (Exception ex) { MessageBox.Show("程序出错 原因:" + ex.Message.ToString()); } #endregion string isSelfStarting = FileReadAndWrite.IniReadValue("temp", "isSelfStarting"); //Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); if (isSelfStarting == CommonStaticParameter.YES) SetSelfStarting(); login = new login(); login.ShowMain += login_ShowMain; login.ShowDialog(); //loginmessage = login.loginMessage; //if (login.loginMessage == "") { //} //if (login.ShowDialog() == DialogResult.OK) //{ } //Application.Run(new TimeManagement()); } else { HandleRunningInstance(instance); } }