我正在尝试获取“ reject_callback
”的源代码,
但是结果与Google Chrome中的inspect中的源代码不一样。
这是我的代码:
https://codal.ir
答案 0 :(得分:1)
假设您只需要静态网页
的源代码 private void Button2_Click(object sender, EventArgs e)
{
string urlAddress = "https://codal.ir";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlAddress);
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
if (response.StatusCode == HttpStatusCode.OK)
{
Stream receiveStream = response.GetResponseStream();
StreamReader readStream = null;
if (response.CharacterSet == null)
{
readStream = new StreamReader(receiveStream);
}
else
{
readStream = new StreamReader(receiveStream, Encoding.GetEncoding(response.CharacterSet));
}
string data = readStream.ReadToEnd(); // Data variable here
readStream.Close();
}
}
}