下面的示例显示如何使用 Socket 类向 HTTP 服务器发送数据和接收响应。 [C#] public string DoSocketGet(string server) { //Sets up variables and a string to write to the server Encoding ASCII = Encoding.ASCII; string Get = “GET / HTTP/1.1\r\nHost: ” + server + “\r\nConnection: Close\r\n\r\n”; Byte[] ByteGet = ASCII.GetByte