//初始化窗体 private void formSelectTicket_Load(object sender, EventArgs e) { if (!hostEnable) tsbtnServerSwitch.Enabled = false; var ticketFrame = new TicketFrame(); ticketFrame.Dock = DockStyle.Fill; ticketFrame.UserName = _userName; ticketFrame.Cookies = cookieContainer; ticketFrame.GetPassengersFromServer(); var tp = new TabPage(); tp.Text = "默认的查询页面"; tp.Controls.Add(new TicketMain(cookieContainer, null,null,ticketFrame) { Dock = DockStyle.Fill, UserName = _userName}); ticketFrame.AddNewTabPage(tp); ticketFrame.InitConfig(); var tpp = new TabPage(); tpp.Text=_userName; tpp.Controls.Add(ticketFrame); tabAccount.TabPages.Add(tpp); tabAccount.SelectedTab = tpp; lb_From_To.Text = DateTime.Now.ToString("yyyy年MM月dd") + "~" + DateTime.Now.AddDays(19).ToString("yyyy年MM月dd"); notice.Text = "12306 订票小助手 C# 版\r\n登录账号:" + _userName; lblVersion.Text = "Version:" + Assembly.GetExecutingAssembly().GetName().Version;; tmUpdateServerTime.Start(); }
//初始化窗体 private void formSelectTicket_Load(object sender, EventArgs e) { if (!hostEnable) { tsbtnServerSwitch.Enabled = false; } var ticketFrame = new TicketFrame(); ticketFrame.Dock = DockStyle.Fill; ticketFrame.UserName = _userName; ticketFrame.Cookies = cookieContainer; ticketFrame.GetPassengersFromServer(); var tp = new TabPage(); tp.Text = "默认的查询页面"; tp.Controls.Add(new TicketMain(cookieContainer, null, null, ticketFrame) { Dock = DockStyle.Fill, UserName = _userName }); ticketFrame.AddNewTabPage(tp); ticketFrame.InitConfig(); var tpp = new TabPage(); tpp.Text = _userName; tpp.Controls.Add(ticketFrame); tabAccount.TabPages.Add(tpp); tabAccount.SelectedTab = tpp; lb_From_To.Text = DateTime.Now.ToString("yyyy年MM月dd") + "~" + DateTime.Now.AddDays(19).ToString("yyyy年MM月dd"); notice.Text = "12306 订票小助手 C# 版\r\n登录账号:" + _userName; lblVersion.Text = "Version:" + Assembly.GetExecutingAssembly().GetName().Version;; tmUpdateServerTime.Start(); }