--新增或修改密码
create proc modifypwd
@uid varchar(16),@pwd varchar(16)
as
declare @encode varbinary(255)
set @encode=convert(varbinary(255),pwdencrypt(@pwd))
if exists(select uid from [user] where uid=@uid)
update [user] set pwd=@encode where uid=@uid
else
insert into [user](uid,pwd) values(@uid,@encode)
go
--判断密码是否正确
CREATE proc checkid
@uid varchar(16),@pwd varchar(16)
as
declare @encode varbinary(255)
select @encode=pwd from [user] where uid=@uid
if pwdcompare(@pwd,@encode,0)='1'
select '登录成功'
else
select '用户名或密码错'
GO
Redis支持使用AUTH命令来设置密码,可以将密码设置为明文或者密文。要将密码设置为密文,需要在redis.conf文件中设置requirepass参数,并将它设置为加密后的密文字符串即可。输入的密码如果是HTML的控件的话<input type="password" name="password1" id="password1" />如果是WEB服务器控件TextBox的话设置它的TextMode为Password即可。 输入进数据库的时候进行"MD5"加密,string password=FormsAuthentication.HahPasswordForStringinConfigFile("要加密的字段") 显示的时候也是设置 TextBox的TextMode的属性为password即可。希望采纳
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)