[英]ASP.NET Web Service and Membership
I try use Membership in asmx web service. 我尝试在asmx Web服务中使用Membership。 I use Web Site Administration Tool, create som roles and users.
我使用网站管理工具,创建som角色和用户。
In asmx web service I create Login method a test some users account. 在asmx Web服务中,我创建一个Login方法来测试一些用户帐户。 It's work ok.
没关系。
[WebMethod]
public string Login(string userName, string userPassword)
{
if(Membership.ValidateUser(userName,userPassword))
{
return "Login succesfull";
}
return "Bad loginName or password";
}
The I add method on create user account. 我在创建用户帐户时添加方法。
[WebMethod]
public void CreateUser(string userName, string userPassword,
string userEmail, string userQuestion, string userAnswer)
{
MembershipCreateStatus status;
try
{
Membership.CreateUser(userName, userPassword,
userEmail, userQuestion, userAnswer, true, out status);
}
catch (MembershipCreateUserException ex)
{
throw ex;
}
catch(Exception ex)
{
throw ex;
}
}
Problem is, if I call webmethod CreateUser user account is not created. 问题是,如果我调用webmethod,则CreateUser用户帐户未创建。 The user data are not written into database.
用户数据未写入数据库。 I don't get any exception when I call webmethod CreateUser, where can be problem?
调用webmethod CreateUser时没有任何异常,这可能是问题所在? Anybody help me?
有人帮我吗 Thank you.
谢谢。
默认情况下,您必须跟进强大的密码输入,必须使用大写字母数字和特殊字符,即使用“ PassW @ rd22”,谢谢哈米德。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.