java数据传给wap站点
2009-04-23 20:54:37 来源:WEB开发网 /**
* 数据传给wap站点
*
* @param message
* @throws IOException
*/
PRivate void settoWap(String message) throws IOException {
URL url;
try {
url = new URL(
"http://www.devdao.com/colgate/inc/msgvote.php?imgid="
+ message+"&mobile="+phone);
HttpURLConnection connection = (HttpURLConnection) url
.openConnection();
connection.setRequestMethod("POST");
connection.setDoOutput(true);
PrintWriter out = new PrintWriter(connection.getOutputStream());
out.close();
BufferedReader in = new BufferedReader(new InputStreamReader(
connection.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
LogTool.WriteLog(line);
System.out.println(line);
}
in.close();
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
更多精彩
赞助商链接