Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 WebBrowser 类登录网站并获取我想要的下载网址。我无法通过 WebBrowser 获取下载,因为我无法以编程方式与下载对话框通信。
根据我的研究,我似乎必须使用 WebClient 来处理我的下载。如何将“经过身份验证的”cookie 从 WebBrowser 传递到 WebClient 并在不打扰对话框的情况下获取我的下载?
您可以使用 InternetGetCookieEx API 获取 WebBrowser 的凭据。然后,您可以将 cookie 集合附加到 HTTPWebRequest 并使用来自 WebBrowser 控件的凭据填充它。
话虽如此,当您说“无法以编程方式与下载对话框通信”时,您是什么意思?您希望进行什么样的交流?