这是.NET 2.0中的Membership API。突然它停止了我的工作。我把它剥离了基础。我尝试创建用户时没有得到任何回复。它没有错误地通过代码,但没有任何反应。这是aspx中的代码:
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", "a@a.com", "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>
答案 0 :(得分:0)
我必须检查MembershipCreateStatus。似乎我发送了重复的电子邮件,这是不允许的。