object nullObject = null ;
axWebBrowser1.Navigate("http://bhg.binhai.com",ref nullObject , ref nullObject , ref nullObject , ref nullObject);
mshtml.IHTMLDocument2 myDocument =(mshtml.IHTMLDocument2)axWebBrowser1.Document;
string aa=myDocument.body.innerHTML;//此句出错。
mshtml.HTMLDocument myDocument =(mshtml.HTMLDocument)axWebBrowser1.Document;
也出错。
axWebBrowser1.Navigate("http://bhg.binhai.com",ref nullObject , ref nullObject , ref nullObject , ref nullObject);
mshtml.IHTMLDocument2 myDocument =(mshtml.IHTMLDocument2)axWebBrowser1.Document;
string aa=myDocument.body.innerHTML;//此句出错。
mshtml.HTMLDocument myDocument =(mshtml.HTMLDocument)axWebBrowser1.Document;
也出错。
解决方案 »
- C# 如何通过程序建立一个宽带连接??跪求
- Encoding.GetBytes()返回的是字节数组吗?我看怎么是AscII数组吗?
- asp.net遇到的问题
- c# winform DateTimePicker绑定数据库字段问题
- 水晶报表导出PDF错误!!!求助!!
- 请问该如何制作cs的安装部署?
- 兄弟们为什么我在系统中加入线程,程序有时候容易出现线程出错的对话框,如线程正在终止的信息,但是点击忽略,系统还是正常启动!
- 请各位大侠介绍几本书??
- 求助大神,为什么DefWndProc向窗体发送的消息没有收到?
- C++自己编写一个查找函数的问题
- 谁会编外挂?
- 什么时候该用sqlcommandbuilder?有什么好处?
mshtml.HTMLDocumentClass myDocument =(mshtml.HTMLDocumentClass)axWebBrowser1.Document;
string aa=myDocument.body.innerTXT;保存此字符串,扩展名改成.htm就可以了
// Download the data to a buffer.
WebClient client = new WebClient(); Byte[] pageData = client.DownloadData("http://www.contoso.com");
string pageHtml = Encoding.ASCII.GetString(pageData);
Console.WriteLine(pageHtml);// Download the data to a file.
client.DownloadFile("http://www.contoso.com", "page.htm");// Upload some form post values.
NameValueCollection form = new NameValueCollection();
form.Add("MyName", "MyValue");
Byte[] responseData = client.UploadValues("http://www.contoso.com/form.aspx", form); }
catch (WebException webEx) {
Console.WriteLine(webEx.ToString());
if(webEx.Status == WebExceptionStatus.ConnectFailure) {
Console.WriteLine("Are you behind a firewall? If so, go through the proxy server.");
}
}