看到一哥们发个标题说送分了,后面一大堆回复,我也赚点点击,大家既然来了,就留下脚印吧,我用httpclient模似登陆,写了段代码,可以登陆开心网,但是不能登陆www.yy365.com这个网站,我把代码贴给大家  HttpClient client = new HttpClient();
        client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);        PostMethod post = new PostMethod("http://www.renren.com/PLogin.do");
        NameValuePair username = new NameValuePair("email", "[email protected]");
        NameValuePair password = new NameValuePair("password", "xxxxxxx");
        post.setRequestHeader("User-Agent","Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10");
        post.setRequestBody(new NameValuePair[] { username, password });
        client.executeMethod(post);
        int status = client.executeMethod(post);
        System.out.println(status);
        byte[] b = post.getResponseBody();
        System.out.println(new String(b,"UTF-8"));
        
        if (status == 301 || status == 302) {
            Header locationHeader = post.getResponseHeader("location");
            if(locationHeader != null){
                String url = locationHeader.getValue(); // 得到跳转href
                GetMethod g = new GetMethod(url);
                client.executeMethod(g);
                byte[] bs = g.getResponseBody();
                System.out.println(new String(bs,"UTF-8"));
            }
        }
        post.releaseConnection();
yy365的网站有点奇怪,www.yy365.com的登陆url我是这么写的
PostMethod post = new PostMethod("http://www.yy365.com/login.do");
但这个url我直接在浏览器里一敲,页面上返回一个"{}" 很郁闷,可能他做了判断还是什么,不太清楚
各位同志们帮我看看啊
不知道对不对,