您好,登錄后才能下訂單哦!
環境:Win7+VS2010+SQLServer 2008R2
2,在web.config里面添加以下代碼即可:
<?xml version="1.0"?>
<!--
有關如何配置 ASP.NET 應用程序的詳細信息,請訪問
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add
name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="NorthwindConnectionString"
applicationName="northWind"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="true"
passwordFormat="Hashed" />
</providers>
</membership>
<roleManager defaultProvider="SqlProvider"
enabled="true"
cacheRolesInCookie="true"
cookieName=".ASPROLES"
cookieTimeout="30"
cookiePath="/"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
cookieProtection="All" >
<providers>
<add
name="SqlProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="NorthwindConnectionString"
applicationName="northWind" />
</providers>
</roleManager>
</system.web>
<connectionStrings>
<!--<add name="DSN_Northwind" connectionString="Server=.;Database=Northwind;UID=sa;pwd=12345" />-->
<add name="NorthwindConnectionString" connectionString="Server=(local);Initial Catalog=aspnetdb;User ID=sa;Password=12345;"
providerName="System.Data.Sqlclient"/>
</connectionStrings>
</configuration>
3,正常之后:
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。