加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

WebServices Exception 之 "401: Access Denied.&#34

发布时间:2020-12-17 02:54:07 所属栏目:安全 来源:网络整理
导读:解决方法一: 使用 Internet 信息服务管理器打开网站或虚拟目录的匿名访问。 解决方法二: 使用客户端身份验证凭据。 WebService ws = new WebService(); ws.Url = "http://localhost/Learn.Web/WebService.asmx"; ws.PreAuthenticate = true; ws.Credential
解决方法一:

使用 Internet 信息服务管理器打开网站或虚拟目录的匿名访问。



解决方法二:

使用客户端身份验证凭据。
WebService ws = new WebService(); ws.Url = "http://localhost/Learn.Web/WebService.asmx"; ws.PreAuthenticate = true; ws.Credentials = System.Net.CredentialCache.DefaultCredentials; // 或 ws.UseDefaultCredentials = true; // .net 2.0 Console.WriteLine(ws.HelloWorld());
?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读