Skip to content

Instantly share code, notes, and snippets.

@seozed
Last active January 10, 2020 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seozed/331e82c774224b40dce4655a3ea42c58 to your computer and use it in GitHub Desktop.
Save seozed/331e82c774224b40dce4655a3ea42c58 to your computer and use it in GitHub Desktop.
C# 笔记
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.IO;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
// 声明一个webclient请求
WebClient wc = new WebClient();
Stream data = wc.OpenRead("http://www.puamap.com");
StreamReader reader = new StreamReader(data);
//这时候才正式开始向服务器发起请求
string s = reader.ReadToEnd();
Console.WriteLine(s);
reader.Close();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment