Rob*_*man 6 .net asp.net security authentication
我需要在网上发布一个演示网站.我需要保护对网站的访问权限.
使用SQL Server作为成员资格提供程序的实时站点.但是,对于演示站点,我只能发布到一个简单的Web主机,并且无法访问SQL Server.
我只需要一个用户,他们不需要更改密码等选项.因此,我认为最简单的方法是使用web.config中的成员.我创建如下:
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.web>
<authentication mode="Forms">
<forms name="ProjectApple" loginUrl="~Login.aspx">
<credentials passwordFormat="Clear">
<user name="lawyer" password="Super12."/>
</credentials>
</forms>
</authentication>
<compilation debug="true"/>
</system.web>
</configuration>
Run Code Online (Sandbox Code Playgroud)
当我可以使用它时,我将使用SHA1哈希.问题是,它在我输入无效密码时识别出来.但是,当我输入正确的密码时,我得到以下内容:
Cannot open user default database. Login failed.
Login failed for user 'RB-T510\Rob'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.
Login failed for user 'RB-T510\Rob'.
Run Code Online (Sandbox Code Playgroud)
我不知道为什么它在寻找SQL?有人可以帮忙吗?
我正在使用VS2010和.Net 3.5
非常感谢,
抢
| 归档时间: |
|
| 查看次数: |
11108 次 |
| 最近记录: |