static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); PageCommon.SetFileLogName(); Application.Run(new FormMain()); }
private void btn_Delete_Click(object sender, EventArgs e) { if (!ckb_Cookie.Checked && !ckb_History.Checked && !ckb_InputRecord.Checked) { PageCommon.ShowInforDiolag("请选择要删除的记录", "提示"); return; } var result = PageCommon.ShowInforDiolag("确认删除记录吗?", "系统提示", MessageBoxButtons.OKCancel); if (result == DialogResult.OK) { PageCommon.ShowInforDiolag(DeleteInfo() ? "删除记录成功!" : "删除记录失败!", "提示"); } }
private void 帮助F1ToolStripMenuItem_Click(object sender, EventArgs e) { //PageCommon.ShowInforDiolag("Welcome to use KINGBrowser.\r\n It's so easy to use,so no help for u.^_^"); try { var helpUrl = GlobalHelper.AppStartupPath + "\\help.html"; if (!tc_PageShow.SelectedTab.Text.Equals("空标签页")) { NewEmptyPage(); } NewUrl(helpUrl); } catch (Exception ex) { FileLog.LogError(ex); PageCommon.ShowInforDiolag("未找到帮助页面!"); } }
/// <summary> /// 保存配置 /// </summary> private void SavePrefer() { prefer = new Preference(cbb_StartPage.SelectedIndex.ToString(), tbx_StartUrl.Text, tbx_HomeUrl.Text, tbx_SearchUrl.Text, ckb_MenuBar.Checked.ToString(), ckb_NavigateBar.Checked.ToString(), ckb_StatusBar.Checked.ToString(), ckb_SearchBar.Checked.ToString(), ckb_HomeBtn.Checked.ToString(), ckb_Shortcut.Checked.ToString(), cbb_Theme.SelectedIndex.ToString()); if (preferManager.SavePreference(prefer)) { var result = PageCommon.ShowInforDiolag("配置成功! 新配置会在重新启动程序后生效, 现在就要重新启动吗?", "系统提示", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { this.Dispose(); mainForm.Dispose(); Application.Restart(); } } else { PageCommon.ShowInforDiolag("配置保存失败!", "错误提示"); } }
/// <summary> /// 设置浏览器所在tab标题 /// </summary> /// <param name="browser"></param> /// <param name="page"></param> private void SetTabTitle(WebBrowser browser, TabPage page) { //var title = PageCommon.GetNewString(browser.DocumentTitle); //var isDefault = browser.Url.AbsoluteUri.Contains(defaultUrl); //page.Text = title.Equals("") ? (isDefault ? "空白页" : "无法访问") : title; var url = browser.Url.ToString(); if (browser.Document != null) { var title = browser.Document.Title; if (url.Equals(defaultUrl)) { title = "空标签页"; tscb_Url.Text = "请输入网址"; tscb_Url.ForeColor = Color.Blue; } else { if (string.IsNullOrEmpty(title)) { title = "无标题文档"; } else if (title.Equals("Internet Explorer 无法显示该网页") || title.Equals("找不到服务器")) { title = "无法显示网页"; } else if (title.Length > 10) { title = PageCommon.GetNewString(title); } tscb_Url.Text = url; tscb_Url.ForeColor = Color.Black; } SetStatusBtn(); page.Text = title; page.Select(); } }
private void 关于AToolStripMenuItem_Click(object sender, EventArgs e) { PageCommon.ShowInforDiolag("Welcome to use KINGBrowser.\r\n\r\n --Power by KING."); }
private void 检查连接LToolStripMenuItem_Click(object sender, EventArgs e) { PageCommon.ShowInforDiolag(IsConnected2Internect() ? "网络已连接." : "网络未连接."); }
private void 序更新UToolStripMenuItem_Click(object sender, EventArgs e) { PageCommon.ShowInforDiolag("你目前使用的版本是: " + PageConst.APP_REVION + "\r\n Update func is coming."); }