static void Main(string[] args) { Console.Title = "支付回调代理服务"; WriteLog("正在启动服务 .."); var http = new HttpListener(); http.StartListen(); WriteLog("支付回调代理服务启动完成 .."); Console.WriteLine(); while (true) { WriteLog("按任意键触发一个http模拟请求 .."); Console.ReadKey(); WriteLog("正在模拟Http请求 .."); var httpClient = new System.Net.WebClient(); httpClient.Headers.Add(System.Net.HttpRequestHeader.ContentType, "pplication/x-www-form-urlencoded"); var postString = "type=test&time=" + DateTime.Now.ToString(@"yyyy\/MM\/dd HH:mm:ss"); httpClient.UploadData(AppConfig.HttpURL, "post", Encoding.UTF8.GetBytes(postString)); WriteLog("请检查tcp客户端是否收到模拟请求的参数 .."); } }