发送的请求你要是不是哦,我给你看看:
GET /zh_cn/download/patch/C4UPD8B.EXE HTTP/1.1
Host: game.china.com
Accept: */*
Referer: http://game.china.com/zh_cn/download/patch/10001402/20011121/10154016.html
User-Agent: NetAnts/1.25
Pragma: no-cache
Cache-Control: no-cache
Connection: close
GET /zh_cn/download/patch/C4UPD8B.EXE HTTP/1.1
Host: game.china.com
Accept: */*
Referer: http://game.china.com/zh_cn/download/patch/10001402/20011121/10154016.html
User-Agent: NetAnts/1.25
Pragma: no-cache
Cache-Control: no-cache
Connection: close
(就是象这样的数据)显示出来。拜托大家帮忙。
try
{
// 需要输入和输出流
DataOutputStream outbound = new DataOutputStream(
clientSocket.getOutputStream() );
DataInputStream inbound = new DataInputStream(
clientSocket.getInputStream() );
// 向服务器发出HTTP请求
outbound.writeBytes("GET / HTTP/1.0\r\n\r\n");
// 读出回应
//接受到的数据
String s;
while ((s= inbound.readLine()) != null)
{// 把每一行显示出来
System.out.println(s);
}// 清除
outbound.close();
inbound.close();
clientSocket.close();
}
catch (IOException ioe)
{
System.out.println("IOException: " + ioe);
}