1

我正在尝试在不使用 API 的情况下登录 Photobucket.com。这是我正在使用的代码,但它不断地退回登录页面。

感谢您的帮助,这几天我一直在搞砸。

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"];
4

0 回答 0