我必须将密码更改为其他内容,我已获得所有详细信息,例如 userid
, username
, encrypted password
, password format
.
如何在 asp.net 成员(member)资格中通过 SQL 更改密码?
最佳答案
您可以使用此查询;
Declare @UserName NVarChar(30)
Declare @Password NVarChar(30)
Declare @Application NVarChar(255)
Declare @PasswordSalt NVarChar(128)
set @UserName = 'UserName'
set @Password = 'Pass'
set @Application = '/Application'
Set @PasswordSalt = (SELECT TOP 1 PasswordSalt FROM aspnet_Membership WHERE UserID IN (SELECT UserID FROM aspnet_Users u, aspnet_Applications a WHERE u.UserName=@UserName and a.ApplicationName = @Application AND u.ApplicationId = a.ApplicationId))
Exec dbo.aspnet_Membership_ResetPassword @Application, @UserName, @Password, 10, 10, @PasswordSalt, -5
关于asp.net - 如何通过 sql server 更改或更新 asp.net 成员(member)中的密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8986294/