写在前面 前面两篇文章分别介绍了基于原始socket的web服务器和基于tcpListener的web服务器,本篇文章将继续介绍另外一种基于HttpListener的. HttpListener HttpListener进一步的简化了Http协议的监听,仅需通过字符串的方法提供监听的地址和端口号以及虚拟路径,就可以开始监听工作了. using System; using System.Collections.Generic; using System.Linq; using System.Net…
1. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.Net.Sockets; using System.Threading; using System.Threading.Tasks; using System.IO; namespace HttpListen { class Program { static…