當前位置:編程學習大全網 - 網站源碼 - 如何C# 獲取 https源碼?

如何C# 獲取 https源碼?

剛學習了下 貼出來獻獻醜

String html = "";

HttpWebRequest req = WebRequest.Create(txtUri.Value) as HttpWebRequest;

HttpWebResponse res = req.GetResponse() as HttpWebResponse;

Stream s = res.GetResponseStream();

if (res.StatusCode == HttpStatusCode.OK)

{

using (s)

{

using (StreamReader sr = new StreamReader(s, Encoding.GetEncoding("gb2312")))

{

html =sr.ReadToEnd();

sr.Close();

}

s.Close();

}

}

  • 上一篇:怎麽手機賺錢
  • 下一篇:用什麽軟件編程能做個模擬鋼琴?
  • copyright 2024編程學習大全網