0
我试图重定向我的程序登录,但保持重定向我 登录页面后“https://uptobox.com/?op=my_account”页面,我试图成功登录后不断重定向到登录页面
request.AllowAutoRedirect = true;
,并使用登录的Cookie到重定向但不工作 登录后在标题中产生的问题,一组饼干我不知道如何来注入到重定向请求&我使用取胜的形式应用的要求
ASCIIEncoding encoding = new ASCIIEncoding();
string postData = "login=" + username + "&password=" + pw +"&op=login";
byte[] data = encoding.GetBytes(postData);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://login.uptobox.com/logarithme");
request.Method = "POST";
CookieContainer mycoockie = new CookieContainer();
request.CookieContainer = mycoockie;
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
Stream stream = request.GetRequestStream();
stream.Write(data, 0, data.Length);
stream.Close();
WebResponse response = request.GetResponse();
stream = response.GetResponseStream();
StreamReader sr = new StreamReader(stream);
string source_code = sr.ReadToEnd();
您是否尝试过context.Redirect? – Svek
我不使用asp.net –