Getting HTML from a page behind a login

前端 未结 8 1998
甜味超标
甜味超标 2021-01-16 05:59

This question is a follow up to my previous question about getting the HTML from an ASPX page. I decided to try using the webclient object, but the problem is that I get the

8条回答
  •  一生所求
    2021-01-16 06:33

    Try setting the credentials property of the WebClient object

    WebClient ww = new WebClient();
    ww.Credentials = CredentialCache.DefaultCredentials;
    ww.DownloadString("Login.aspx?UserName=&Password=");
    string html = ww.DownloadString("Internal.aspx");
    

提交回复
热议问题