Is it possible to transfer authentication from Webbrowser to WebRequest

后端 未结 9 2100
无人共我
无人共我 2020-11-27 14:10

I\'m using webbrowser control to login any site. And then i want to download some sub page html using WebRequest (or WebClient). This links must requires authentication.

9条回答
  •  余生分开走
    2020-11-27 14:41

    A late answer for future references. WebBrowser uses UrlMon library which manages the session per-process, so UrlMon APIs like URLOpenStream or URLDownloadToFile can be used to download any resource on the same session (the APIs can be called from C# via P/invoke). A similar question answered here.

提交回复
热议问题