2012-11-20 34 views
1

我习惯使用Forms Authentication与数据库,但我正在写一个内部的实用程序,该应用程序没有数据库,所以我想在web.config中存储用户名和密码。然而,由于某种原因,表单身份验证仍然试图访问SQL Server,我看不到如何阻止它这样做,并从web.config中获取证书。我究竟做错了什么?我刚刚收到错误“由于模拟客户端失败而无法生成SQL Server的用户实例,连接将被关闭。”表单身份验证:您如何在web.config中存储用户名密码?

这里是我的web.config中的相关章节:

<configuration> 
    <system.web> 
     <authentication mode="Forms"> 
      <forms loginUrl="~/Login.aspx" timeout="60" name=".LoginCookie" path="/" > 
       <credentials passwordFormat="Clear"> 
        <user name="user1" password="[pass]" /> 
        <user name="user2" password="[pass]" /> 
       </credentials> 
      </forms> 
     </authentication> 
     <authorization> 
      <deny users="?" /> 
     </authorization> 
    </system.web> 
</configuration> 
+0

[在web.config文件中加密和存储密码](http://stackoverflow.com/questions/7356537/encrypt-and-store-password-in-web-config-file) –

回答

相关问题