Загрузка...

How to get html of a page after authorization

Thread in C# created by karpz99 Feb 7, 2019. 127 views

  1. karpz99
    karpz99 Topic starter Feb 7, 2019 0 Feb 6, 2019
    подскажите как получить html страницы после авторизации
    Code

    byte[] bytes = Encoding.GetEncoding(1251).GetBytes(string.Format("user={0}&pass={1}&login_submit=%CE%F2%EF%F0%E0%E2%E8%F2%FC", login, password));
    httpRequest.ClearAllHeaders();
    httpRequest.KeepAlive = true;
    httpRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19";
    httpRequest.Referer = "https://site.ru";
    httpRequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
    httpRequest.AllowAutoRedirect = false;
    httpRequest.Cookies = Network.Cookie;
    if (httpRequest.Post("https:site.ru", bytes).HasRedirect)
     
Top
Loading...