Using HTTP Authentication with a C# WebRequest

前端 未结 3 2042
生来不讨喜
生来不讨喜 2020-12-11 00:17

I want to make a web request to a page that needs authenticating. How would I go about doing this? I found something that said possibly to use the Credentials property, but

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-11 00:39

    It is also possible to authenticate automatically with. This will use the credentials of the currently logged on user.

    webClient.Credentials = CredentialCache.DefaultCredentials
    

提交回复
热议问题