110,536
社区成员
发帖
与我相关
我的任务
分享
//windows集成验证:
YourUpLoadServiceRef.WebServiceName ws= new YourUpLoadServiceRef.WebServiceName ();
// Create a new instance of CredentialCache.
CredentialCache credentialCache = new CredentialCache();
// Create a new instance of NetworkCredential using the client credentials.
NetworkCredential credentials = new NetworkCredential("windows登录用户名", "登录密码");
// Add the NetworkCredential to the CredentialCache.
credentialCache.Add(new Uri(math.Url), "NTLM", credentials);
// Add the CredentialCache to the proxy class credentials.
math.Credentials = credentialCache;
// Call the method on the proxy class.
string Str = math.HelloWorld("keycom");
//基本身份验证:
YourUpLoadServiceRef.WebServiceName ws= new YourUpLoadServiceRef.WebServiceName ();
ws.Credentials = new System.Net.NetworkCredential("windows登录用户名", "登录密码");