private void Form1_Load(object sender, EventArgs e) { label2.Text = "MAC:" + mac; if (!Init()) { System.Environment.Exit(0); } label3.Text = lid + "-" + stid; label5.Visible = false; DS.SetConnectStr(strSql); if (DS.PadLoginInfo(Convert.ToInt32(lid), Convert.ToInt32(stid), mac, 1) == 2) { MessageBox.Show("配置文件中站号线号有重复", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } //if (DS.PadLoginInfo(Convert.ToInt32(lid), Convert.ToInt32(stid), mac, 0) == 1) //{ // //只有当前线开机 // DS.GetPadOnInfo(-1);//获取全部 // DS.GetPadFinishInfo(-1); // DS.GetPadReaderData(); //} else { DS.GetChanges(); timer1_Tick(null, null); //DS.GetPadOnInfo(Convert.ToInt32(lid));//获取分配给其的 } this.timer1.Interval = this.trackBar1.Value * 1000; timer1.Enabled = true; if (ShowAllScreen == "ON") { ShowAllSc(); } else { ShowBySeqKind(SeqKind); } }
private void Init() { setDataColumn(); filestr = Globals.CGlobal.inifile;//inifile=路径+\Risun.ini iFile = new Globals.CIniIFile(filestr); lid = iFile.GetString("PADSECTION", "LINE", "0"); stid = iFile.GetString("PADSECTION", "STATION", "0"); try { this.timer1.Interval = (iFile.GetInt("PADSECTION", "RefreshSecWLBM", 3)) * 1000; this.trackBar1.Value = (iFile.GetInt("PADSECTION", "RefreshSecWLBM", 5)); label7.Text = this.trackBar1.Value + "秒"; } catch { } strSql = @"Data Source=" + iFile.GetString("LOCALSERVER", "Server", ".") + ";Initial Catalog=SUNRISE10_CDB;" + "User ID=" + iFile.GetString("LOCALSERVER", "User", "sa") + ";Password="******"LOCALSERVER", "Pwd", ""); DS.SetConnectStr(strSql); }