如何通过 sql server 更改或更新 asp.net 会员中的密码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8986294/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 14:06:58 来源:igfitidea点击:
How can i change or update password in asp.net membership via sql server
提问by Mr A
I have to change a password to something else, I have got all the details like userid
, username
, encrypted password
, password format
.
我必须将密码更改为其他内容,我已获得所有详细信息,例如userid
, username
, encrypted password
, password format
。
How can I change the password via SQL in asp.net membership?
如何在 asp.net 会员资格中通过 SQL 更改密码?
回答by oOZz
You can use this query;
您可以使用此查询;
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 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