daily pastebin goal
7%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 64 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. string sUrl = "login.aspx";
  2. HttpWebRequest oRequest = (HttpWebRequest)WebRequest.Create(sUrl);
  3. CookieContainer oMyCookies = new CookieContainer();
  4. oRequest.CookieContainer = oMyCookies;
  5. // encode postdata into byte array.  the postdata string format will most likely be different and you'll have to examine the postdata going back and forth using some firefox addon like LiveHTTPHeaders
  6. byte[] oPostData = System.Encoding.UTF8.GetBytes("username=" + HttpUtility.UrlEncode(sUser) + "&pass=" HttpUtility.UrlEncode(sPass));
  7. using (Stream oStream = oRequest.GetRequestStream())
  8. {
  9.     oStream.Write(oPostData, 0, oPostData.Length);
  10. }
  11. HttpWebResponse oResponse = oRequest.GetResponse();
  12. // save response cookies in our cookie object for future sessions!
  13. foreach (Cookie oCookie in oResponse.Cookies)
  14. {
  15.     oMyCookies.SetCookies(sUrl, oCookie.ToString());
  16. }
  17. // maybe check response headers for location
  18. string sResponseContents = null;
  19. using (StreamReader oReader = new StreamReader(oResponse.GetResponseStream())
  20. {
  21.     // store server response into string
  22.     sResponseContents = oReader.ReadToEnd();
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top