C#不使用API登录Photobucket.com

C#不使用API登录Photobucket.com,c#,login,photobucket,C#,Login,Photobucket,我正在尝试登录Photobucket.com而不使用那里的API。这是我正在使用的代码,但它一直在回退登录页面 谢谢你的帮助,我已经搞了好几天了 string formUrl = "https://login.photobucket.com/login"; string formParams = string.Format("ts={0}&sig={1}&usernameemail={2}&password={3}&redir={4}&redirectAc

我正在尝试登录Photobucket.com而不使用那里的API。这是我正在使用的代码,但它一直在回退登录页面

谢谢你的帮助,我已经搞了好几天了

string formUrl = "https://login.photobucket.com/login";
string formParams = string.Format("ts={0}&sig={1}&usernameemail={2}&password={3}&redir={4}&redirectAction={5}&redirectParams={6}&returnUrl={7}&action={8}", ts, sig, email, password,"","","","","login");

string cookieHeader;
WebRequest req = WebRequest.Create(formUrl);
req.ContentType = "application/x-www-form-urlencoded";
req.Method = "POST";
byte[] bytes = Encoding.ASCII.GetBytes(formParams);
req.ContentLength = bytes.Length;
Using (Stream os = req.GetRequestStream())
{
  os.Write(bytes, 0, bytes.Length);
}
WebResponse resp = req.GetResponse();
cookieHeader = resp.Headers["Set-cookie"];

但是这就是API的全部意义。我需要用户能够登录到API目前不支持的私有PhotoBucket。