用C#实现WEB浏览器

类别:.NET开发 点击:0 评论:0 推荐:

废话少说,看代码。。。

private AxSHDocVw.AxWebBrowser axWebBrowser1;
  private System.Windows.Forms.Button button1;
  private System.Windows.Forms.Label label1;
  private AxShockwaveFlashObjects.AxShockwaveFlash axShockwaveFlash1;

   System.Threading.Thread thread1=new System.Threading.Thread(new System.Threading.ThreadStart(thread_WebBrowse));
   thread1.Start();

  private void thread_WebBrowse()
  {
   //这是一个try的用法,遇上错误抛出异常
   try
   {
    Object n=null;
    this.axWebBrowser1.Navigate("www.sina.com.cn",ref n,ref n,ref n,ref n);
   }
   catch(Exception ex)
   {
    this.label_Output.Text=ex.ToString();
   }
  }

本文地址:http://com.8s8s.com/it/it42820.htm