【问题标题】:Where does the MVC3 default template store user-account information?MVC3 默认模板在哪里存储用户帐户信息?
【发布时间】:2011-10-15 10:00:06
【问题描述】:

你能告诉我注册新帐户时asp.net mvc3默认模板在哪里存储登录信息吗?它在本地以调试模式运行。

在没有安装 SQLExpress 的情况下,注册功能根本不起作用。由于我已经安装了,可以使用注册/登录功能,但是在SQLExpress中找不到存放这种数据的表。 SQLExpress中有master、model、msdb和tempdb,它们是系统数据库。

你能帮帮我吗?谢谢!

【问题讨论】:

    标签: .net asp.net asp.net-mvc asp.net-mvc-3


    【解决方案1】:

    查看 web.config。

    <membership>
          <providers>
            <clear/>
            <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
                 enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
                 maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
                 applicationName="/" />
          </providers>
        </membership>
    

    所以插入的成员资格提供程序是 SqlMembershipProvider,使用名为 ApplicationServices 的连接字符串:

    <connectionStrings>
        <add name="ApplicationServices"
             connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
             providerName="System.Data.SqlClient" />
      </connectionStrings>
    

    因此,如果您在项目(文件系统)中查看 App_Data,您会看到一个名为 aspnetdb.mdf 的文件,这是存储用户的位置。

    Here's some more info on SQL Server Express.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-01-03
      • 2013-02-23
      • 2013-11-16
      • 2021-04-12
      • 1970-01-01
      • 2014-10-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多