/// <summary> /// 打开一个网站 /// </summary> /// <param name="url">网站URL</param> public void Go(string url) { try { AxWebBrowser1.Navigate(url); cobURL.Text = url; labStatus.Text = "正在打开网站 " + url; AxWebBrowser1.Focus(); Application.DoEvents(); AddItemToToolStripComboBox(cobURL, url); } catch (Exception) { } }
private void tsbGo_Click(object sender, EventArgs e) { string URL = tscmbURL.Text.Trim(); if (URL.ToUpper().IndexOf("HTTP://") < 0) { if (URL.IndexOf(".") < 0) { URL = "http://www.baidu.com/s?ie=gb2312&bs=test&sr=&z=&cl=3&f=8&wd=" + URL + "&ct=0"; } else { URL = URL.Insert(0, "http://"); } tscmbURL.Text = URL; } AxWebBrowser1.Navigate(URL); if (tscmbURL.Items.IndexOf(URL) < 0) { tscmbURL.Items.Add(URL); } }
public WebBrowser(WeifenLuo.WinFormsUI.DockPanel dp, string URL) { InitializeComponent(); this.m_dp = dp; AxWebBrowser1.Navigate(URL); }
public WebBrowser(string URL) { InitializeComponent(); AxWebBrowser1.Navigate(URL); }