解决方案 »

  1.   

    http://blog.csdn.net/jdgdf566/article/details/16357677
    userName
    Password 
    CookieDate 3
    referer http://www.51zxw.net/show.aspx?id=30365&cid=436
      

  2.   

    用上面的网址的那个:import http.Http;  
    import java.util.*;  
    import java.io.*;  public class NewClass {  
      
        public static void main(String[] args) throws Exception {  
            String charset = "gbk";  
            Http http = new Http("http://www.51zxw.net/show.aspx?id=30365&cid=436", charset);  
            /** 
             * 登录 
             */  
            http.addPostData("userName", "username中文");  
            http.addPostData("Password", "password中文");  
            http.addPostData("CookieDate", "3");
            http.addPostData("referer", "http://www.51zxw.net/show.aspx?id=30365&cid=436");
            http.execute();        InputStreamReader isr = new InputStreamReader(http.getInputStream(), charset);  
            StringBuilder stringBuilder = new StringBuilder();  
            int len;  
            char[] cbuf = new char[1024];  
            while ((len = isr.read(cbuf)) >= 0) {  
                if (len == 1024) {  
                    stringBuilder.append(cbuf);  
                } else {  
                    stringBuilder.append(cbuf, 0, len);  
                }  
            }  
            System.out.println(stringBuilder.toString());
        }
    }
    userName Password 你自己注册个,改上就可以了。
      

  3.   


    可以把你的Http类也贴出来吗?
      

  4.   

    你这个功能研究一下下面这些就够了:URL url = new URL("http://www.51zxw.net/show.aspx?id=30365&cid=436");
    connection = (HttpURLConnection) url.openConnection();connection.setRequestMethod("POST");
    connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=" + this.charset);
    connection.setDoOutput(true);String s = URLEncoder.encode(username, charset);
    String data = "userName=" + s + "&" ......
    connection.connect();
    connection.getOutputStream().write(data.getBytes(charset));
            InputStreamReader isr = new InputStreamReader(connection.getInputStream(), charset);  
            StringBuilder stringBuilder = new StringBuilder();  
            int len;  
            char[] cbuf = new char[1024];  
            while ((len = isr.read(cbuf)) >= 0) {  
                    stringBuilder.append(cbuf, 0, len);  
            }  
            System.out.println(stringBuilder.toString());