HTML section
When a user is logged into the security area of your site, you can use the Login_user in the ServerVariables collection to understand the logged in user account, and of course remember to turn off the Allow anonymous login, and now look at the HTML section first.
<form action= "changepwd.asp" method= "POST" >
<!--use hidden--> in order not to allow users to enter accounts themselves
<input type= "hidden" name= "UserName"
Value= "<%=request.servervariables (" Login_user ")%>" >
<br> Enter old password: <input name= "Oldpwd" >
<br> Enter new password: <input name= "NEWPWD1" >
<br> Confirm New Password: <input name= "NEWPWD2" >
<input type= "Submit" value= "Change Password" >
</form>
Program code
The next part of the ASP, see how to modify the WIndows 2000 user account through ADSI, and save the bottom program code as a changepwd.asp file name
<%
Oldpwd = Request.Form ("Oldpwd")
NEWPWD1 = Request.Form ("NewPwd1")
NEWPWD2 = Request.Form ("NewPwd2")
UserName = Request.Form ("UserName")
If NewPwd1 = NewPwd2 Then
Set ouser = GetObject ("winnt://computername/" & UserName)
Ouser.changepassword Oldpwd, NEWPWD1
Ouser.setinfo
Set ouser = Nothing
Else
Response.Write, "Please reconfirm your password."
End If
%>