You have to add similiar code like this ...
//Create an instance of the CredentialCache class.
CredentialCache cache = new CredentialCache();
// Add a NetworkCredential instance to CredentialCache.
// Negotiate for NTLM or Kerberos authentication.
cache.Add( new Uri(myProxy.Url), "Negotiate", new NetworkCredential("UserName", "Password", "Domain"));
//Assign CredentialCache to the Web service Client Proxy(myProxy) Credetials property.
myProxy.Credentials = cache;
or Visual basic.Net
'Create an instance of the CredentialCache class.
Dim cache As CredentialCache = New CredentialCache()
'Add a NetworkCredential instance to CredentialCache.
'Negotiate for NTLM or Kerberos authentication.
cache.Add(New Uri(myProxy.Url), "Negotiate", New NetworkCredential("UserName", "Password", "Domain"))
'Assign CredentialCache to the Web service Client Proxy(myProxy) Credetials property.
myProxy.Credentials = cache
Use System.Net.CredentialCache.DefaultCredentials instead of new NetworkCredential("UserName", "Password", "Domain") if you want to pass the currently logged in user credentials. Make sure you have anonymous access disabled in IIS.
ASP.Net Tips & Tricks - Jawad's Blog