Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Web browser control and bypassing authentication
Message
 
To
02/01/2005 23:57:38
General information
Forum:
ASP.NET
Category:
Web control library
Miscellaneous
Thread ID:
00973739
Message ID:
00973744
Views:
14
I have dropped a Web browser control on my form. I am accessing a page which requires a basic authentication. We already have the username and password enter in a configuration. How can I access that page without having the prompt of the basic authentication?

I'm not really sure what you mean but I'll give it a shot:

I'm gonna assume that you are using the app.config file and the setting is like so:
<appSetting>
     <add key="UserName" value="myusername" />
     <add key="Password" value="mysecretpassword" />
</appSetting>
... So, you can use the following line of code to access the values:
string userName = 
     System.Configuration.ConfigurationSettings.AppSettings["UserName"];
string password = 
     System.Configuration.ConfigurationSettings.AppSettings["Password"];
Within a try...catch block you can use userName and password to authenticate the user... If the user hasn't provided those values you can then ask for authentication.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform