0
這是.NET 2.0中的Membership API。突然它停止了對我的工作。我已將其剝離到基礎。我嘗試創建用戶時沒有得到任何回覆。它通過代碼沒有錯誤,但沒有任何反應。這裏是在ASPX代碼:爲什麼Membership.CreateUser函數什麼都不做?
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim mcf As System.Web.Security.MembershipCreateStatus
Membership.CreateUser("kingfish", "password1", "[email protected]", "what is it?", "widget", True, mcf)
End Sub
,這裏是在web.config代碼:
<add name="LocalSqlServer" connectionString="Data Source=localhost;Initial Catalog=MyDB;Integrated Security=True" providerName="System.Data.SqlClient"/>
<membership defaultProvider="CustomizedProvider">
<providers>
<add name="CustomizedProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="LocalSqlServer"
applicationName="MyApp"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0" />
</providers>
</membership>
如果需要,可以添加以下內容以允許重複的電子郵件:
Stefan
2009-10-19 14:29:07