using Microsoft.Win32; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using UI.Framework.Forms; namespace FLSystem.Forms { public partial class WPHNavForm : BaseForm { public bool isIgnore = false; public WPHNavForm() { InitializeComponent(); } private void WPHNavForm_FormClosing(object sender, FormClosingEventArgs e) { isIgnore = checkEdit1.Checked; this.DialogResult = DialogResult.OK; } private string LoginUrl = "https://union.vip.com/index"; private void simpleButton1_Click(object sender, EventArgs e) { try { //从注册表中读取默认浏览器可执行文件路径 RegistryKey key = Registry.ClassesRoot.OpenSubKey(@"http\shell\open\command\"); string s = key.GetValue("").ToString(); System.Diagnostics.Process.Start(s.Substring(0, s.Length - 8), LoginUrl); } catch (Exception) { try { System.Diagnostics.Process.Start(LoginUrl); } catch (Exception) { MessageBox.Show("抱歉,无法启动【默认浏览器】,已经将网址复制到粘贴板,请复制到网页端进行注册!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } private void WPHNavForm_Load(object sender, EventArgs e) { } } }