views:

19

answers:

1

When I want to connect to my web service If I write it like this:

m_TransferServiceSoap.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

it is working. but I need a Login Form. so users can enter their user/pass

so I am creating a NetworkCredential instance and setting its user/pass members from what I get from that login form and then instead of using the line above I am writing this one:

m_TransferServiceSoap.Credentials = userpass; // the instance above.

but in this way when I call a method of that webService, it gives me errors .

Is it the wrong way to set credentials?

+2  A: 
Patrick
one more question about that:right now my domain name has some pattern like this, which is set by the company "WHQ_A_DOMAIN\myUser" .but I am not sure How it will look like when our clients are using it on their own domains?so is there a way I can get the "Domain" name ? something that for example in my case would return "WHQ_A_DOMAIN"
BDotA
Ok, looks like Environment.UserDomainName returns the domain name.so always the pattern is like this: DOMAIN\userName
BDotA