//我一网页中位为户端,提交数据到这个服务器,怎样获取提交的数据,而不带消息头?
ServerSocket ss = new ServerSocket(10012);//监听10012端口
Socket s = ss.accept();//获取socket
String ip = s.getInetAddress().getHostAddress();
System.out.println(ip+"连接");
OutputStream os = s.getOutputStream();
PrintWriter pw = new PrintWriter(os,true);
pw.println("注册成功");
s.shutdownOutput();
InputStream bwIn = s.getInputStream();
byte[] buf = new byte[1024];
int len = 0;
FileOutputStream fos = new FileOutputStream("D:\\tra\\export.txt");//怎样获取注册表单中提交的数据呢?不带消息头的,怎样实现?
while((len = bwIn.read(buf))!=-1)
{
fos.write(buf,0,len);
}
s.shutdownInput();
fos.close();
//没人知道这个怎么做吗?