//下面为新添加的版本信息更新的方法 public static void CheckHBVersion_New() { //bool bPowerOn = CoreInterface.GetBoardStatus() != JetStatusEnum.PowerOff; HEAD_BOARD_TYPE headBoardType = (HEAD_BOARD_TYPE)CoreInterface.get_HeadBoardType(true); SBoardInfo sBoardInfo = new SBoardInfo(); if (CoreInterface.GetBoardInfo(0, ref sBoardInfo) != 0) { SFWVersion fwv = new SFWVersion(sBoardInfo.m_nHBBoardVersion); string sVersion = fwv.m_nMainVersion.ToString() + "." + fwv.m_nSubVersion.ToString() + "." + fwv.m_nBuildVersion.ToString() + "." + fwv.m_nHWVersion.ToString(); string sql = "select VERSION_REPLACE.DISPLAY_REASON,VERSION_REPLACE.SUBMIT_TIME from VERSION_REPLACE left " + "join VERSION_INFO on VERSION_REPLACE.REPLACE_VID=VERSION_INFO.VID where VERSION_INFO.VERSION_NUM='" + sVersion + "' " + "and VERSION_INFO.HBTYPE='" + headBoardType.ToString() + "' ORDER BY VERSION_REPLACE.SUBMIT_TIME DESC"; DataTable data = SqliteHelp.SelectData(sql); if (data != null && data.Rows.Count > 0) { string msg = data.Rows[0][0].ToString(); if (!string.IsNullOrEmpty(msg.Trim())) { MessageBox.Show(msg.Trim(), @"头板版本更新提示"); } } } }
public static void DownHeadVersionInfoDataBase_SQLite() { try { if (LocalConnectionStatus()) { //第一个参数是 下载地址, //第二个参数是 下载后的临时文件地址, //第三个参数是 下载完成后,将临时文件保存到的指定地址 string filename = Path.Combine(Application.StartupPath, @"DownloadFile.exe"); string url = "http://47.93.225.113:5002/KeyValueStores/ExportData"; string dbtemp = Path.Combine(Application.StartupPath, @"HeadVersionInfoTemp.db"); string db = Path.Combine(Application.StartupPath, @"HeadVersionInfo.db"); string dbtime = ""; string sql = "select DBVersion.PublishTime from DBVersion"; DataTable data = SqliteHelp.SelectData(sql); if (data != null && data.Rows.Count > 0) { string msg = data.Rows[0][0].ToString(); if (!string.IsNullOrEmpty(msg.Trim())) { dbtime = msg; } } else { dbtime = DateTime.MinValue.ToString("G"); } Process[] ps = Process.GetProcessesByName("ConsoleApp"); foreach (Process process in ps) { process.Kill(); } if (File.Exists(filename)) { Process process = new Process { StartInfo = { FileName = filename, CreateNoWindow = true, UseShellExecute = false, Arguments = url + " " + dbtemp + " " + db + " \"DBName=f8b11d42-3446-4126-906a-64d43fea1728&PublishTime=" + DateTime.Parse(dbtime).ToString("yyyy-MM-dd") + "\" UniqueName=f8b11d42-3446-4126-906a-64d43fea1728" } }; process.Start(); } } } catch { } }