如下代码内容是关于C#发送简单的HTTP请求的代码,应该能对大家有用处。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
namespace WRApp
{
class Program
{
static void Main(string[] args)
{
WebResponse resp = req.GetResponse();
StreamReader reader = new StreamReader(resp.GetResponseStream(), Encoding.ASCII);
Console.WriteLine(reader.ReadToEnd()); }
}
}
}