加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

在ASP.NET中的Web.Config中模拟标签

发布时间:2020-12-15 23:34:10 所属栏目:asp.Net 来源:网络整理
导读:我在Asp.net 4.0网站的web.config中使用impersonate标签. 下面是我的Web.Config代码: system.web authentication mode="Windows" identity impersonate="true" userName="Administrator" password="LALLA$26526"/ /authentication/system.web 当我在Visual
我在Asp.net 4.0网站的web.config中使用impersonate标签.

下面是我的Web.Config代码:

<system.web>

        <authentication mode="Windows">
            <identity impersonate="true"                 
                userName="Administrator" 
                password="LALLA$26526"/>
         </authentication>

</system.web>

当我在Visual Studio中运行应用程序时,我得到这个错误:

Parser Error Message: Unrecognized element 'identity'.

源错误:

Line 50:    <system.web>
Line 51:        <authentication mode="Windows">
Line 52:            <identity impersonate="true"             
Line 53:                 userName="Administrator"
Line 54:                 password="LALLA$26526"/>

我在哪里错了?

解决方法

身份部分在system.web部分下,不在身份验证中:
<system.web>
  <authentication mode="Windows"/>
  <identity impersonate="true" userName="foo" password="bar"/>
</system.web>

(编辑:李大同)

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

    推荐文章
      热点阅读