我試圖用httpwebrequest打開adfoc.us/504....9鏈接。 但它沒有給我HTML代碼。無法獲取HTML
try
{
req = WebRequest.Create(txtLink.Text);
WebProxy wp = new WebProxy(proxies[0]);
//req.Proxy = wp;
WebResponse wr = req.GetResponse();
StreamReader sr = new StreamReader(wr.GetResponseStream());
string content = sr.ReadToEnd();
MessageBox.Show(content);
sr.Close();
}
catch (UriFormatException)
{
MessageBox.Show("URL should be in this format:\nhttp://www.google.com");
return;
}
如果我使用網站像[google.com] [1] - 我得到谷歌html源碼的mbox。 如果我使用adfoc.us/50....
鏈接,我會得到一個空字符串。
問題出在哪裏? 謝謝。
編輯:我通過安裝GeckoFx組件解決了這個問題。
因爲此鏈接不包含任何內容 – akhil 2012-07-09 09:47:15
當我如何在瀏覽器中打開它?我檢查了篡改數據,我認爲有一些重定向。 – 2012-07-09 09:48:36
我沒有收到任何重定向。 – ZippyV 2012-07-09 09:49:57