2011-07-01 208 views

回答

1

WebClient对象具有能为你做这个的方法:

WebClient client = new WebClient(); 
string html = client.DownloadString("http://www.google.com"); 
+0

+1,虽然这将包括标记为好。 – Yuck

+0

上面的例子只适用于老版本,不适用于我的Visual Studio 2008.正确的代码是: #using using namespace System :: Net; 使用命名空间System :: IO; 使用命名空间System; (){ WebClient^client = gcnew WebClient; CString html = client-> DownloadString(_T(“http://www.google.bg/”)); } – Trepach