.net - How do I authenticate a user to consume a web service programmatically? -


I have a web service set on an IIS server when I navigate to the page in a web browser, then I want to In the form, I ask for a username, though I have to serve one. Want to consume in the NET application (C #). What do I need to do to provide a username and password program so that I can use the service? Or is there any other way that I should authenticate the user?

Try something like this:

  YourWebReference webservice = New YourWebReference (); Webservice.Credentials = New System.Net.NetworkCredential ("user name", "password"); Webservice.DoSomething ();  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -