Do I need to set the NetworkCredential domain?

Do I need to set the networkCredential domain when accessing the web service?

var service = new service1.SoapEx(); service.Credentials = new NetworkCredential("user", "password", "domain"); 

or i can do:

  var service = new service1.SoapEx(); service.Credentials = new NetworkCredential("user", "password"); 

thanks

+6
source share
1 answer

No, this is not necessary, since the NetworkCredential class contains a constructor, just like your second example. Keep in mind that the password parameter accepts only SecureString, not String.

+3
source

All Articles