private void SFIS_DCT_INPUT_Load(object sender, EventArgs e) { string C_RES = string.Empty; try { if (!Directory.Exists("C:\\SFIS")) { Directory.CreateDirectory("C:\\SFIS"); } C_RES = "检查程序版本方法连接失败"; chkver = new WebServices.Check_Version.Check_Version(); if (!chkver.CheckPrgVsersion("SFIS_DCT_INPUT", this.ProductVersion, null, null, null)) { SendPrgMsg(mLogMsgType.Error, "该程序为版本不是最新版\r\n请更新后运行"); RunFile(System.Windows.Forms.Application.StartupPath + @"\", "AutoUpdate.exe", "ISCM.exe"); this.Enabled = false; } lbl = new ApplicationClass(); SendPrgMsg(mLogMsgType.Incoming, "初始化CodeSoft成功"); Initialization = new InitializationPrg(InitializationInfo); Initialization.BeginInvoke(null, null); txt_userid.Enabled = false; txt_sn.Enabled = false; txt_kpsn.Enabled = false; } catch { SendPrgMsg(mLogMsgType.Error, C_RES); } }
private void Frm_Input_Load(object sender, EventArgs e) { if (!Directory.Exists("C:\\SFIS")) { Directory.CreateDirectory("C:\\SFIS"); } string _StrErr = string.Empty; chkver = new WebServices.Check_Version.Check_Version(); if (!chkver.CheckPrgVsersion("TEST_INPUT", this.ProductVersion, null, null, null, out _StrErr)) { if (_StrErr == "OK") { SendPrgMsg(Color.Red, "该程序为版本不是最新版\r\n请更新后运行"); RunFile(System.Windows.Forms.Application.StartupPath + @"\", "AutoUpdate.exe", "ISCM.exe"); } else { SendPrgMsg(Color.Red, "检查版本失败:" + _StrErr); } this.Enabled = false; } Initialization = new InitializationPrg(InitializationInfo); Initialization.BeginInvoke(null, null); }
/// <summary> /// 加载基础数据 /// </summary> private void LoadDefaultData() { tb_wo.Focus(); string C_RES = ""; try { C_RES = "加载 对象[WebServices.tWipTracking] 失败 "; twip = new WebServices.tWipTracking.tWipTracking(); C_RES = "加载 对象[WebServices.tBomKeyPart] 失败 "; bkp = new WebServices.tBomKeyPart.tBomKeyPart(); C_RES = "加载 对象[WebServices.tWoInfo] 失败 "; tWoInfo = new WebServices.tWoInfo.tWoInfo(); C_RES = "加载 对象[WebServices.tLineInfo] 失败 "; tLineInfo = new WebServices.tLineInfo.tLineInfo(); C_RES = "加载 对象[WebServices.tPublicStoredproc] 失败 "; PubStor = new WebServices.tPublicStoredproc.tPublicStoredproc(); C_RES = "加载员工信息失败"; tuser = new WebServices.tUserInfo.tUserInfo(); C_RES = "加载检查版本信息失败"; chkver = new WebServices.Check_Version.Check_Version(); C_RES = "加载线体资料失败"; LoadLineInfo(); SendPrgMsg(mLogMsgType.Incoming, "基础数据加载完成"); SendPrgMsg(mLogMsgType.Incoming, "请选择基础数据后输入权限..."); } catch { SendPrgMsg(mLogMsgType.Error, C_RES); this.Enabled = false; } }
private void Frm_BoxPrint_Load(object sender, EventArgs e) { if (!ChkSoftInstall("CODESOFT 7")) { MessageBoxEx.Show("本机没有安装Codesoft 7 不能使用"); this.Enabled = false; return; } if (!Directory.Exists("C:\\SFIS")) { Directory.CreateDirectory("C:\\SFIS"); } FileVersionInfo myFileVersion = FileVersionInfo.GetVersionInfo(System.Windows.Forms.Application.ExecutablePath); this.groupBox1.Text += string.Format("(Version: {0})", myFileVersion.FileVersion); string _StrErr = string.Empty; chkver = new WebServices.Check_Version.Check_Version(); if (!chkver.CheckPrgVsersion("BOX_PRINT", this.ProductVersion, null, null, null, out _StrErr)) { if (_StrErr == "OK") { SendMsg(mLogMsgType.Error, "该程序为版本不是最新版\r\n请更新后运行"); RunFile(System.Windows.Forms.Application.StartupPath + @"\", "AutoUpdate.exe", "ISCM.exe"); } else { SendMsg(mLogMsgType.Error, "检查版本失败:" + _StrErr); } this.Enabled = false; } IniPrg = new IntPrgConfig(IniPrgConfigInfo); IniPrg.BeginInvoke(null, null); tb_Input.Enabled = false; tb_wo.Focus(); string filePath = System.Environment.CurrentDirectory + "\\SFIS_ISCM.ini"; LabDir = ReadIniFile.IniReadValue("BoxPrint", "Patch", filePath); NumX.Value = Convert.ToInt16(ReadIniFile.IniReadValue("BoxPrint", "X", filePath)); NumY.Value = Convert.ToInt16(ReadIniFile.IniReadValue("BoxPrint", "Y", filePath)); LabLine.Text = string.Empty; LabLine.Text = Encoder.Encoder.DecryptString(Encoder.ReadIniFile.IniReadValue("BOX_PRINT", "LINE", IniFilePath)); }
private void Frm_TEST_INPUT_Load(object sender, EventArgs e) { chkver = new WebServices.Check_Version.Check_Version(); string _StrErr = string.Empty; if (!chkver.CheckPrgVsersion("TEST_INPUT", this.ProductVersion, null, null, null, out _StrErr)) { if (_StrErr == "OK") { MessageBox.Show("该程序为版本不是最新版\r\n请更新后运行"); this.Enabled = false; RunFile(System.Windows.Forms.Application.StartupPath + @"\", "AutoUpdate.exe", appfilename); } else { MessageBox.Show("检查版本发生异常:" + _StrErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); } 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; } this.Text = "PHICOMM TEST_INPUT " + this.ProductVersion; //System.DateTime d1 = System.DateTime.Parse("2015/07/30"); //System.DateTime d2 = System.DateTime.Now; //System.TimeSpan ts = d1 - d2; //if (ts.Days <= 0) //{ // MessageBox.Show("试用时间超出,请联系系统开发人员"); // this.Close(); // return; //} Initialization = new InitializationPrg(InitializationInfo); Initialization.BeginInvoke(null, null); tb_Input.Focus(); }
static refWebCheck_Version() { instance = new WebServices.Check_Version.Check_Version(); }
private void SFIS_DCT_V2_Load(object sender, EventArgs e) { chkver = new WebServices.Check_Version.Check_Version(); string _StrErr = string.Empty; if (!chkver.CheckPrgVsersion("SFIS_DCT_V3", Application.ProductVersion, null, null, null, out _StrErr)) { if (_StrErr == "OK") { MessageBox.Show("该程序为版本不是最新版\r\n请更新后运行"); RunFile(System.Windows.Forms.Application.StartupPath + @"\", "AutoUpdate.exe", appfilename); } else { MessageBox.Show("检查程序版本异常\r\n " + _StrErr); } string FileName = System.IO.Path.GetFileName(Application.ExecutablePath); Process[] prc = Process.GetProcessesByName(FileName.Substring(0, FileName.LastIndexOf('.'))); if (prc.Length > 0) { foreach (Process pc in prc) { pc.Kill(); } } return; } this.Text = "SFIS_DCT_V3 Version: " + Application.ProductVersion; tbMessage.Text = "正在初始......"; this.PalConfig.Enabled = true; this.PalData.Enabled = true; Initialization = new InitializationPrg(InitializationInfo); Initialization.BeginInvoke(null, null); AutoRun.Interval = 100; AutoRun.Enabled = false; AutoRun.Tick += new EventHandler(AutoRun_Tick); btsetup.Enabled = false; string filePath = System.Environment.CurrentDirectory + "\\SFIS_DCT.ini"; string _Port = ReadIniFile.IniReadValue("DATABASE", "myport", filePath); string _BaudRate = ReadIniFile.IniReadValue("DATABASE", "BaudRate", filePath); string _DataBits = ReadIniFile.IniReadValue("DATABASE", "DataBits", filePath); string _Parity = ReadIniFile.IniReadValue("DATABASE", "Parity", filePath); string _StopBits = ReadIniFile.IniReadValue("DATABASE", "StopBits", filePath); string _ReadBufferSize = ReadIniFile.IniReadValue("DATABASE", "ReadBufferSize", filePath); LabDir = ReadIniFile.IniReadValue("LABEL", "Patch", filePath); try { sPort = new System.IO.Ports.SerialPort(); sPort.PortName = "COM" + _Port; sPort.BaudRate = int.Parse(_BaudRate); //串口通信波特率19200 sPort.ReadBufferSize = int.Parse(_ReadBufferSize); sPort.DataBits = int.Parse(_DataBits); //数据位 8 sPort.Parity = (Parity)Enum.Parse(typeof(Parity), _Parity); //奇偶校验0 sPort.StopBits = (StopBits)Enum.Parse(typeof(StopBits), _StopBits); //System.IO.Ports.StopBits.One;//停止位 sPort.ReadTimeout = 1000; //读超时 sPort.WriteTimeout = 1000; sPort.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(sPort_DataReceived); sPort.Open(); comstatus.Text = "COM OK"; PortFlag = true; } catch { comstatus.Text = "COM FAIL"; PortFlag = false; } }