·您的位置: 首页 » 资源教程 » 编程开发 » ASP » 用ASP修改NT登陆密码

用ASP修改NT登陆密码

类别: ASP教程  评论数:0 总得分:0
<%
Sub ChangeUserPassword(Computer,UserName,oldPassword,newPassword)
Dim adsUser,foundErr,ErrMsg
On Error Resume Next
foundErr=False
ErrMsg=""
Set adsUser=GetObject("WinNT://"+Computer+"/"+UserName+",user")
If Err.Number<>0 Then
foundErr=True
ErrMsg="User not found!"
Err.Clear
Else
adsUser.ChangePassword oldPassword, newPassword
adsUser.SetInfo
If Err.Number<>0 Then
foundErr=True
ErrMsg=Now & ". Error Code: " & Hex(Err) & " - " & Err.Description & "
"
Err.Clear
End If
End If
If Not foundErr Then
objContext.SetComplete
Response.Write "<font class=""A2"" size=""2"" face=""Arial"">[B]Password changed successful!
[/B]

"
Response.Write "<input type=""button"" class=""A1"" name=""b2"" value="" Back ""
onclick=""window.location.replace(\'default.asp\');"">"
Response.Write "</font>"
Else
objContext.SetAbort
Response.Write "<font class=""A2"" size=""2"" face=""Arial"">[B]Wrong old password, back to
reinput![/B]

"&ErrMsg
Response.Write "<input type=""button"" class=""A1"" name=""b2"" value="" Back ""
onclick=""history.back();"">"
Response.Write "</font>"
End If
Set adsUser=Nothing
End Sub

response.write "NT的密码改为qian!"
Computer="yp"
UserName="sky"
oldPassword="dir"
newPassword="qian"
ChangeUserPassword Computer,UserName,oldPassword,newPassword
%>
-= 资 源 教 程 =-
文 章 搜 索
关键词:
类型:
范围:
纯粹空间 softpure.com
Copyright © 2006-2008 暖阳制作 版权所有
QQ: 15242663 (拒绝闲聊)  Email: faisun@sina.com
 纯粹空间 - 韩国酷站|酷站欣赏|教程大全|资源下载|免费博客|美女壁纸|设计素材|技术论坛   Valid XHTML 1.0 Transitional
百度搜索 谷歌搜索 Alexa搜索 | 粤ICP备19116064号-1