我Socket用来获取http响应www.google.com.vn
TcpClient c = new TcpClient();
IPAddress ip = IPAddress.Parse("74.125.128.94"); // www.google.com.vn
IPEndPoint remoteEP = new IPEndPoint(ip, 80);
c.Connect(remoteEP);
StreamReader sr = new StreamReader(c.GetStream());
String s = sr.ReadToEnd();
Console.WriteLine(s);
Run Code Online (Sandbox Code Playgroud)
我没有得到任何结果.什么问题?
| 归档时间: |
|
| 查看次数: |
645 次 |
| 最近记录: |