2011-07-01 204 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