//System.out.println(response);
//打印出服务器返回的注册成功或失败的数据
ps.println(response + "
");
//打印出用户注册的信息
ps.println("username=" + username + "
");
ps.println("password=" + password + "
");
ps.println("gender=" + gender + "
");
ps.println("interest=" + interest + "
");
ps.println("city=" + city + "
");
ps.println("photo=" + photo + "
");
//关闭本线程的流
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}.start();
}
}
//获取键值的方法,并且对值进行解码
public static String getParameter(String content, String key) throws UnsupportedEncodingException{
String[] entryArr = content.split("&");
for (String contents : entryArr) {
String[] arr = contents.split("=");
if(arr[0].equals(key))
return arr.length == 2 URLDecoder.decode(arr[1], "GBK") : "";
}
return null;
}
}