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

  • 关于我们
  • 免责声明