Hello,
I need help loging into Fileserve.com,
I want to get to a specific page behind the login,
can you see an error with this code:
CookieContainer cookieContainer = new CookieContainer();
string html;
string loginData = "POSTDATA=loginUserName" + usrnm + "&loginUserPassword=" + pswrd + "&autoLogin=on&&ppp=102&loginFormSubmit=Login";
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("http://fileserve.com/index.php");
req.CookieContainer = cookieContainer;
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] loginDataBytes = encoding.GetBytes(loginData);
req.ContentLength = loginDataBytes.Length;
Stream stream = req.GetRequestStream();
stream.Write(loginDataBytes, 0, loginDataBytes.Length);
stream.Close();
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
req = (HttpWebRequest)HttpWebRequest.Create("http://fileserve.com/file-manager.php");
req.CookieContainer = cookieContainer;
req.Method = "GET";
res = (HttpWebResponse)req.GetResponse();
StreamReader sr = new StreamReader(res.GetResponseStream());
html = sr.ReadToEnd();
I only get the login page not the one I want,I used Tamper to get the Post Parameters & Values.
for those who knows jdownloader (Filehosting app written in Java), I took a look at the fileserve plugin there and tried to change my logindata to equal it with the jdownloader data
setBrowserExclusive();
br.setFollowRedirects(true);
br.postPage("http://fileserve.com/login.php", "loginUserName=" + Encoding.urlEncode(account.getUser()) + "&loginUserPassword=" + Encoding.urlEncode(account.getPass()) + "&autoLogin=on&loginFormSubmit=Login");
br.getPage("http://fileserve.com/dashboard.php");
String accType = br.getRegex("<h5>Account type:</h5>[\r\n ]+<h3>(Premium|Free)</h3>").getMatch(0);
now loginData looks like this:
"loginUserName=" + usrnm + "&loginUserPassword=" + pswrd + "&autoLogin=on&loginFormSubmit=Login";
and
(HttpWebRequest)HttpWebRequest.Create("http://fileserve.com/login.php");
still no success,
maybe I'm missing something?