aspnet_regsql-C "Data Source=.\SQLEXPRESS;Integrated Security=True;User Instance=True" ...
將產生由連接字符串
給你還應該配置的MembershipProvider程序與數據庫進行工作數據庫。只需將其添加到您的web.config中
<configuration>
<connectionStrings>
<add name="SqlServices" connectionString="Data Source=.\SQLEXPRESS;Integrated Security=True;User Instance=True" />
</connectionStrings>
<system.web>
<authentication mode="Forms" >
<forms loginUrl="login.aspx"
name=".ASPXFORMSAUTH" />
</authentication>
<membership defaultProvider="SqlProvider"
userIsOnlineTimeWindow="15">
<providers>
<add
name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SqlServices"
applicationName="MyApplication"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="10" />
</providers>
</membership>
</system.web>
</configuration>