您好,登錄后才能下訂單哦!
環(huán)境:Win7+VS2010+SQLServer 2008R2
2,在web.config里面添加以下代碼即可:
<?xml version="1.0"?>
<!--
有關(guān)如何配置 ASP.NET 應(yīng)用程序的詳細(xì)信息,請(qǐng)?jiān)L問
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,正常之后:
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。