//打开网站按钮 private void button1_Click(object sender, EventArgs e) { string url = "http://hbpiao.3322.org:6000/IA/Default.aspx"; if (GlobalVar2.gbConnectType != 1) { url = "http://hbpiao.3322.org:6000/IA/Default.aspx"; } try { PrintTicket.RunProgram("C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE", url); } catch { try { PrintTicket.RunProgram("D:\\Program Files\\Internet Explorer\\IEXPLORE.EXE", url); } catch { } } }
private void admin(object sender, EventArgs e) { try { PrintTicket.RunProgram("C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE", GlobalVar.WebUrl + "?user="******"&pwd=" + GlobalVar.loginPassword); } catch { try { PrintTicket.RunProgram("D:\\Program Files\\Internet Explorer\\IEXPLORE.EXE", GlobalVar.WebUrl + "?user="******"&pwd=" + GlobalVar.loginPassword); } catch { } } }
static public void FixFont() { if (ExistFont("TEC1")) { MessageBox.Show("字体已经存在"); } else { string fn = Environment.SystemDirectory; fn = fn.Substring(0, fn.LastIndexOf("\\")) + "\\fonts\\tec.ttf"; string batfile = "c:\\fixfont.cmd"; FileStream fs = new FileStream(batfile, FileMode.Create, FileAccess.Write); StreamWriter sw = new StreamWriter(fs); sw.WriteLine("copy " + fn + " c:\\tec.ttf"); sw.WriteLine("del " + fn); sw.WriteLine("copy c:\\tec.ttf " + fn); sw.Close(); fs.Close(); PrintTicket.RunProgram("c:\\fixfont.cmd", ""); } }
static void Main() { EagleString.EagleFileIO.LogWrite("Starting Mainform..."); if (!mutex.WaitOne(5000, false)) //等待5秒, 如果有相同实例运行则给用户提示 { EagleString.EagleFileIO.LogWrite("已存在 Mainform 的运行实例."); return; } try { AutoUpdate(); try { Properties.Settings.Default.Reload(); } catch { } DateTime ProgressStartTime = DateTime.Now;//用于杀死当前进程的判断 //EagleString.EagleFileIO.CreateShortCut20(); //EagleString.EagleFileIO.BackupOptionsXml(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); GlobalVar.printProgram = false;//版本控制(true:打印与false:订票版本) GlobalVar.serverAddr = GlobalVar.ServerAddr.NA; BookTicket.bIbe = false; //try //{ // if (EagleAPI2.ValidateFiles())//修复丢失文件 // return; //} //catch (Exception ex) //{ // EagleString.EagleFileIO.LogWrite("ValidateFiles : " + ex.Message); //} XMLConfig.XMLSettingsGlobal xmlConfig = new XMLSettingsGlobal().Read("XMLConfigGlobal.xml") as XMLSettingsGlobal; XMLConfigUser user = new XMLConfigUser().Read() as XMLConfigUser; GlobalVar.WebServer = xmlConfig.LoginWebService; GlobalVar.WebUrl = xmlConfig.Website; string[] credential = xmlConfig.LoginCredential.Split(','); if (credential.Length > 1) { GlobalVar.loginName = credential[0]; GlobalVar.loginPassword = credential[1]; Options.GlobalVar.B2bLoginName = credential[0]; Options.GlobalVar.B2bLoginPassword = credential[1]; } //EagleString.ServerCenterB2B sc = new EagleString.ServerCenterB2B(); ////sc.ServerAddressB2B((EagleString.ServerAddr)byte.Parse(root), //// EagleString.LineProvider.DianXin, //// 0, //// ref GlobalVar.WebServer, //// ref GlobalVar.WebUrl); Options.GlobalVar.IALoginUrl = xmlConfig.Website; Options.GlobalVar.IALoginUrl1 = xmlConfig.Website1; Options.GlobalVar.IALoginUrl2 = xmlConfig.Website2; Options.GlobalVar.B2bWebServiceURL = xmlConfig.LoginWebService; Options.GlobalVar.B2bWebServiceURL1 = xmlConfig.LoginWebService1; Options.GlobalVar.B2bWebServiceURL2 = xmlConfig.LoginWebService2; Options.GlobalVar.RemotingUrl = xmlConfig.RemotingUrl; Options.GlobalVar.IAWebServiceURL = xmlConfig.IAWebServiceURL; Options.GlobalVar.IAWebServiceURL1 = xmlConfig.IAWebServiceURL1; Options.GlobalVar.IAWebServiceURL2 = xmlConfig.IAWebServiceURL2; Options.GlobalVar.QueryType = xmlConfig.QueryType; //兼容性代码,用于参数复制,记得删除 if (user.IACode == "1") { user.IACode = xmlConfig.IACode; user.SelectedISP = xmlConfig.SelectedISP; user.Save(); } Options.GlobalVar.IACode = user.IACode; Options.GlobalVar.SelectedISP = user.SelectedISP; LogonForm logon = new LogonForm(); if (logon.ShowDialog() == DialogResult.OK) { SplashScreen.Splasher.Status = "正在启动…"; try { SplashScreen.Splasher.Banner = Image.FromFile("login.jpg"); } catch { } SplashScreen.Splasher.Show(typeof(SplashScreen.frmSplash)); frmMain mainForm = new frmMain(); Application.Run(mainForm); GlobalVar.commServer.Close(); EagleAPI2.DeleteSubmittedPnr(); } else { try { GlobalAPI.Hosts.setDefault(); } catch { } return; } GlobalVar.mylis.AbortWork(); LogoutForm lf = new LogoutForm(); lf.ShowDialog(); try { GlobalAPI.Hosts.setDefault(); } catch { } EagleString.BaseFunc.KillProcess("iprinter", ProgressStartTime); if (GlobalVar.gbIsRestartEagle) { PrintTicket.RunProgram(Application.StartupPath + "\\iprinter.exe", ""); } } finally { mutex.ReleaseMutex(); } }
private void btSetTitleOffset_Click(object sender, EventArgs e) { PrintTicket.RunProgram(Environment.SystemDirectory + "\\notepad.exe", Application.StartupPath + "\\EagleIns.ini"); }