日期:2014-05-20  浏览次数:20693 次

未导入jar文件
下面这个程序是网上的一段关于登陆人人网然后抓取相关信息的程序,但是未导入jar文件包,小弟刚刚学习java不久,望大神们能给写全import jar文件,我导入了一些,但是还是报错,希望各位大神帮忙看一下,看看是程序的问题还是jar文件不全的问题,这个程序对我很有用,大神们一定要帮帮小弟
public
 class RenRen {  
    // The configuration items
 
    private
 static String userName = "YourMailinRenren";  
    private
 static String password = "YourPassword";  
    private
 static String redirectURL = "http://blog.renren.com/blog/304317577/449470467";  

 
    // Don't change the following URL
 
    private
 static String renRenLoginURL = "http://www.renren.com/PLogin.do";  

 
    // The HttpClient is used in one session
 
    private HttpResponse response;  
    private DefaultHttpClient httpclient = new DefaultHttpClient();  

 
    private
 boolean login() {  
        HttpPost httpost = new HttpPost(renRenLoginURL);  
        // All the parameters post to the web site
 
        List<NameValuePair> nvps = new ArrayList<NameValuePair>();  
        nvps.add(new BasicNameValuePair("origURL", redirectURL));  
        nvps.add(new BasicNameValuePair("domain", "renren.com"));  
        nvps.add(new BasicNameValuePair("isplogin", "true"));  
        nvps.add(new BasicNameValuePair("formName", ""));  
        nvps.add(new BasicNameValuePair("method", ""));  
        nvps.add(new BasicNameValuePair("submit", "登录"));  
        nvps.add(new BasicNameValuePair("email", userName));  
        nvps.add(new BasicNameValuePair("password", password));  
        try {  
            httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));