C# WebApi中的WebBrowser
对不起,我英语不好C# WebApi中的WebBrowser,c#,iis,webbrowser-control,C#,Iis,Webbrowser Control,对不起,我英语不好 访问一个需要登录的页面,我使用WebBrowser,运行IIS Express works(在visual studio中运行) 问题是,当我在Amazon服务器上配置应用程序时(也使用IIS),它只会丢失站点所需的身份验证 示例代码: using (WebBrowser webBrowser = new WebBrowser()) { //authentication is here webBrowser.Navigate("http://www.example.
using (WebBrowser webBrowser = new WebBrowser())
{
//authentication is here
webBrowser.Navigate("http://www.example.com/user=admin/password=123123");
//page that I need to access
webBrowser.Navigate("http://www.example.com/downloads/doc.pdf");
}
OBS:此代码通过运行visual studio来工作,问题是当我设置Amazon服务器时,它会丢失身份验证
WebBrowser
不是为ASP.NET设计的。请使用类似Chrome的东西,因为它支持无头模式,某些东西可能在Visual Studio中工作,这仅仅是因为IIS Express在您的用户会话中以您自己的身份运行您的web应用程序。但是,一旦在IIS上,web应用将不再在您的帐户下运行,并且它也将在会话0中隔离。谢谢您的回答