I'm working with C#.net developing applications for windows mobile 6, and i need get the HTML code from a web page, i mean, i need download the page and then get the code or parse it to string.
我正在使用C#.net开发Windows Mobile 6的应用程序,我需要从网页上获取HTML代码,我的意思是,我需要下载页面然后获取代码或将其解析为字符串。
someone know how can i do it?
有人知道我该怎么办?
I know there is the WebClient Class for desktop app, but i didn't find something like that for mobile app
我知道桌面应用程序有WebClient类,但我没有找到类似移动应用程序的东西
2 个解决方案
#1
You can use the HttpWebRequest class to make a GET request and read the HTML code.
您可以使用HttpWebRequest类发出GET请求并读取HTML代码。
#2
Use the System.Net.WebClient class and call DownloadStringAsync to download any resource from the web asynchronously.
使用System.Net.WebClient类并调用DownloadStringAsync以异步方式从Web下载任何资源。
#1
You can use the HttpWebRequest class to make a GET request and read the HTML code.
您可以使用HttpWebRequest类发出GET请求并读取HTML代码。
#2
Use the System.Net.WebClient class and call DownloadStringAsync to download any resource from the web asynchronously.
使用System.Net.WebClient类并调用DownloadStringAsync以异步方式从Web下载任何资源。