logo
  • 教程列表
  • SO官方文檔
  • 執行 HTTP 請求
    • 建立和傳送 HTTP POST 請求
    • 建立和傳送 HTTP GET 請求
    • 特定 HTTP 響應程式碼的錯誤處理(例如 404 Not Found)
    • 使用 JSON 正文傳送非同步 HTTP POST 請求
    • 檢索網頁的 HTML(簡單)
    • 傳送非同步 HTTP GET 請求並讀取 JSON 請求
  1. StackOverflow 文件
  2. C# Language 教程
  3. 執行 HTTP 請求
  4. 檢索網頁的 HTML(簡單)

檢索網頁的 HTML(簡單)

Created: November-22, 2018

string contents = "";
string url = "http://msdn.microsoft.com";

using (System.Net.WebClient client = new System.Net.WebClient())
{
    contents = client.DownloadString(url);
}

Console.WriteLine(contents);
  • 傳送非同步 HTTP GET 請求並讀取 JSON 請求
  • 使用 JSON 正文傳送非同步 HTTP POST 請求

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明