当前位置:编程学习 > C#/ASP.NET >>

用C#实现WEB浏览器

答案:废话少说,看代码。。。

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();
}
}


上一个:C#:ListBox的2个常用方法Add,Clear与Items的2个属性
下一个:C#读写注册表

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,