private void Form1_Load(object sender, EventArgs e) { if (!Directory.Exists("C:\\SFIS")) { Directory.CreateDirectory("C:\\SFIS"); } FileVersionInfo myFileVersion = FileVersionInfo.GetVersionInfo(System.Windows.Forms.Application.ExecutablePath); this.Text = string.Format("SMT_STOCKIN Version:{0} (Build Date:{1})", myFileVersion.FileVersion, System.IO.File.GetLastWriteTime(Application.ExecutablePath).ToShortDateString()); if (!chkver.CheckPrgVsersion("SMT_STOCKIN", System.Windows.Forms.Application.ProductVersion, null, null, null)) { RunFile(System.Windows.Forms.Application.StartupPath + @"\", "AutoUpdate.exe", appfilename); MessageBox.Show("该程序为版本不是最新版\r\n请更新后运行"); string FileName = System.IO.Path.GetFileName(System.Windows.Forms.Application.ExecutablePath); Process[] prc = Process.GetProcessesByName(FileName.Substring(0, FileName.LastIndexOf('.'))); if (prc.Length > 0) { foreach (Process pc in prc) { pc.Kill(); } } return; } // LabLine.Text = Encoder.Encoder.DecryptString(Encoder.ReadIniFile.IniReadValue("SMT_STOCKIN", "LINE", IniFilePath)); LabLine.Text = OperateINI.IniReadValue("SMT_STOCKIN", "LINE", IniFilePath); // oDB.ConnDB(); UserLogin ul = new UserLogin(this); if (ul.ShowDialog() == DialogResult.OK) { LabUser.Text = userId; //cb_line.Items.Clear(); //List<string> LsLine = oDB.Get_Line_Info(); //foreach (string item in LsLine) //{ // cb_line.Items.Add(item); //} //cb_line.SelectedIndex = 0; Check_woId_Data(); } else { this.Close(); } }
private void imbt_selectline_Click(object sender, EventArgs e) { Dictionary <string, object> dic = new Dictionary <string, object>(); Frm_Public.Frm_Select fd = new Frm_Public.Frm_Select(oDB.Get_ALL_Line_Info(), ref dic); if (fd.ShowDialog() == DialogResult.OK) { LabLine.Text = dic["线别"].ToString(); OperateINI.IniWriteValue("SMT_STOCKIN", "LINE", dic["线别"].ToString(), IniFilePath); } //string[] EmpData = Input.InputBox.ShowInputBox("输入权限", string.Empty); //try //{ // string UserId = EmpData[0]; // string PWD = EmpData[1]; // if (!string.IsNullOrEmpty(UserId) && !string.IsNullOrEmpty(PWD)) // { // IDictionary<string, object> user_dic = new Dictionary<string, object>(); // user_dic.Add("USERID", UserId); // user_dic.Add("PWD", PWD); // string _StrErr = oDB.CHECK_SET_LINE_EMPLOYEE(user_dic); // if (_StrErr == "OK") // { // ShowMsg(mLogMsgType.Incoming, "权限正确"); // Dictionary<string, object> dic = new Dictionary<string, object>(); // Frm_Public.Frm_Select fd = new Frm_Public.Frm_Select(oDB.Get_ALL_Line_Info(), ref dic); // if (fd.ShowDialog() == DialogResult.OK) // { // LabLine.Text = dic["线别"].ToString(); // Encoder.ReadIniFile.IniWriteValue("SMT_STOCKIN", "LINE", Encoder.Encoder.EncryptString(dic["线别"].ToString()), IniFilePath); // } // } // else // { // ShowMsg(mLogMsgType.Error, _StrErr); // } // } //} //catch //{ // ShowMsg(mLogMsgType.Error, "权限格式不正确"); //} }