/// <summary> /// 检查更新 /// </summary> public static void checkUpdate(DbManager db, MainFrm mainFrm, bool isDefault) { Dictionary <string, string> sysConfig = db.getRow2Dic("sysConfig"); string version = sysConfig["version"]; string updateUrl = sysConfig["updateUrl"]; string localUpdateExeName = sysConfig["localUpdateExeName"]; try { string urlStr = updateUrl + @"?type=version&isTest=0&version=" + version; string html = HttpSend.GetSend(urlStr); //获取页面报文 if (html != "false" && html != "") { //如果对话框已经打开,就不要再提示了 if (isOpenUpdateDialog) { return; } DialogResult result = MessageBox.Show("发现系统更新,要现在升级吗?", "系统更新", MessageBoxButtons.YesNo, MessageBoxIcon.Information); isOpenUpdateDialog = true; if (result == DialogResult.Yes) { isOpenUpdateDialog = false; string defaultPath = getSystemDefaultDirectory(); db.close(); Process p = new Process(); p.StartInfo.UseShellExecute = true; p.StartInfo.FileName = localUpdateExeName; p.StartInfo.Arguments = "mainCallBack"; p.Start(); mainFrm.Dispose(); mainFrm.Close(); } else if (result == DialogResult.No) { isOpenUpdateDialog = false; } } else { if (!isDefault) { MessageBox.Show("当前已是最新版本【" + version + "】"); } } } catch (Exception ex) { MessageBox.Show("检查升级失败!原因为:" + ex.Message);; } }
public static bool getUserRegInfo(string ip, DbManager db) { Dictionary <string, string> sysConfig = db.getRow2Dic("sysConfig"); string userInfoUrl = sysConfig["userInfoUrl"]; try { string urlStr = userInfoUrl + @"?ip=" + ip + "&inode=" + getiNodeUsername(); string html = HttpSend.GetSend(urlStr); //获取页面报文 return(userInfoUI(html)); } catch (Exception ex) { //MessageBox.Show("获取注册信息失败!原因为:" + ex.Message); return(false); } }