Mein Code bis jetzt :
Code:
public static String Login(String Username, String Passwort)
{
URL url;
String urlParameters = "vb_login_username=" + Username + "&vb_login_password=" + Passwort + "&cookieuser=1&s=&securitytoken=1366913511-8bebf234b0c61d0c961b2e5d9e199505b56ed718&do=login&vb_login_md5password=&vb_login_md5password_utf=";
HttpURLConnection connection = null;
try {
url = new URL("http://www.elitepvpers.com/forum/login.php?do=login");
connection = (HttpURLConnection)url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
connection.setRequestProperty("Content-Length", "" +
Integer.toString(urlParameters.getBytes().length));
connection.setRequestProperty("Content-Language", "en-US");
connection.setUseCaches (false);
connection.setDoInput(true);
connection.setDoOutput(true);
DataOutputStream wr = new DataOutputStream (
connection.getOutputStream ());
wr.writeBytes (urlParameters);
wr.flush ();
wr.close ();
InputStream is = connection.getInputStream();
BufferedReader rd = new BufferedReader(new InputStreamReader(is));
String line;
StringBuffer response = new StringBuffer();
while((line = rd.readLine()) != null) {
response.append(line);
response.append('\r');
}
rd.close();
return response.toString();
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
if(connection != null) {
connection.disconnect();
}
}
}







