WEB开发网
开发学院WEB开发Jsp java数据传给wap站点 阅读

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( &quo

 /**
   * 数据传给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();
     }

   }

Tags:java 数据 传给

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接