注册 | 登录
收藏 | 帮助
热门文章
编辑推荐
相关文章  
网友经验:手工剿灭木马“advapi
教你穿透ADSL路由入侵内网
一分钟攻破ADSL盗遍宽带密码
宽带上网 小心有诈 浅谈ADSL入侵
ADSL用户注意的安全问题
电信ADSL用户必读:ADSL账号密码
震惊!远程盗取ADSL帐号很简单(
如果密码是admin 小心你的信息安
DNS 系统设定例--8.[Rev] 特殊网
DNS 系统设定例--9.[Rev] 特殊网
您现在的位置: 顶尖设计 >> IT学院 >> 编程开发 >> VB >> 文章正文
基于ADSI的NT帐号及Exchange Server帐号申请及验证模块源代码
作者:zhengsb  来源:CSDN  点击:  更新:2006-12-19
简介:
gt;<input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p>
</form>

</body>

</html>

b>响应文件UserAdd.asp
<HTML>
<head>
<meta name="Microsoft Theme" content="mstheme1530 1111, default">
</head>
<BODY>
<H1> </H1>
<%
 
  '  Variables
dim rbox
set rbox = Server.CreateObject("RbsBoxGen.NTUserManager")
'以下如果已在DLL的初始化事件中设置正确则无须设置,可提高安全性
'rbox.Domain="yourdomain"
'rbox.Admin="administrator"
'rbox.password="XXXXXX"
'rbox.Ntserver="yonrntserver"
'rbox.EmailAddress="@Xxx.xxx"
'rbox.ExchServer="yourExchangeServerName"
'rbox.ExchSite="yourExchangeSiteName"
'rbox.ExchOrganization="yourExchangeOrganizationName"
  rbox.getuserinfo
   
  rbox.CreateUser 
  'rbox.DeleteUser 

  if rbox.isok then
  set rbox = nothing
  response.write "注册成功!"
  else
  set rbox = nothing
  response.write "该用户名已被使用,请换一个名字再试!"
  end if
 

%>
</BODY>
</HTML>

2修改密码:
a>.密码修改页面CHPWD.htm
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub cmdOk_OnClick
Dim TheForm
Set TheForm = Document.MyForm

opwd=trim(TheForm.opwd.Value)
npwd=trim(TheForm.npwd.Value)
cpwd=trim(TheForm.cpwd.Value)

if opwd="" then
  msgbox "请输入旧密码!"
  exit sub
end if

if npwd="" then
  msgbox "请输入新密码!"
  exit sub
end if
 
if cpwd="" then
  msgbox "请输入确认密码!"
  exit sub
end if

if npwd<>cpwd then
  msgbox "新密码与确认密码不一致!"
  exit sub
end if

if ucase(opwd)=ucase(npwd) then
msgbox "新密码不得与旧密码相同!"
exit sub
end if

if len(npwd)<3 then
msgbox "新密码长度不得小于3位!"
exit sub
end if

TheForm.submit

End Sub
//-->
</SCRIPT>


<meta name="Microsoft Theme" content="mstheme1530 1111, default">
</head>

<body>
<form method="POST" action="Chpwd.asp" name="myform" target="_self">
<div align="center">
  <center>
<table width="100%" height="100%"><tr>
    <td valign="middle" align="center">
<div align="center">
  <center>
<table width="256" height="100" cellspacing="0" cellpadding="0" border="1" bordercolor="#FFFFFF"><tr><td>
  <div align="center">
    <center>
    <table border="0" width="256" height="100" cellspacing="0" cellpadding="0" bgcolor="#C0C0C0">
      <tr>
        <td width="92"> </td>
        <td width="160" colspan="2"> </td>
      </tr>
    </center>
    <tr>
      <td width="92">
        <p align="center"><font size="3">旧 密 码:</font></td>
      <td width="160" colspan="2"><input type="password" name="oPwd" size="20"></td>
      </tr>
      <tr>
        <td width="92">
          <p align="center"><font size="3">新 密 码:</font></td>
        <td width="160" colspan="2"><input type="password" name="nPWD" size="20"></td>
      </tr>
      <tr>
        <td width="92">
          <p align="center"><font size="3">确认密码:</font></td>
        <td width="160" colspan="2"><input type="password" name="cPwd" size="20"></td>
      </tr>
      <tr>
        <td width="92"> </td>
        <td width="160" colspan="2">
          <p align="center"> </td>
      </tr>
      <tr>
        <td width="92"> </td>
        <td width="80">
          <p align="center"><input type="button" value="确定" name="cmdOK"></p>
        </td>
        <td width="80">
          <p align="center"><input type="button" value="取消" name="Cancel" onclick="JavaScript:history.back();"></td>
      </tr>
      <tr>
        <td width="92"> </td>
        <td width="80"> </td>
        <td width="80"> </td>
      </tr>
    </table>
  </div>
</td></tr></table> 
  </center>
</div></tr></table>
  </center>
</div>
</form>
</body>

</html>

b>响应文件CHPWD.asp
<HTML>

<head>
<meta name="Microsoft Theme" content="mstheme1530 1111, default">
</head>

<BODY>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" height="100%" align="center" valign="middle">
<%
 
  '  Variables
  dim rbox

  uid=session("SID_UID")
  opwd=request.form("opwd")
  npwd=request.form("npwd")
  cpwd=request.form("cpwd")
 
  if opwd="" then
  response.write "请输入旧密码!"
  response.end
  end if

if npwd="" then
  response.write "请输入新密码!"
  response.end
end if
 
if cpwd="" then
  response.write "请输入确认密码!"
  response.end
end if

if npwd<>cpwd then
  response.write "新密码与确认密码不一致!"
  response.end
end if

if ucase(opwd)=ucase(npwd) then
response.write "新密码不得与旧密码相同!"
response.end
end if

if len(npwd)<3 then
response.write "新密码长度不得小于3位!"
response.end
end if

set rbox = Server.CreateObject("RbsBoxGen.NTUserManager")

' rbox.ResetPwd uid,npwd 
' rbox.Login uid,npwd
  rbox.ChangePwd uid,opwd,npwd
   
  if rbox.isok then
  set rbox = nothing
  response.write "密码更改成功!"
  else
  set rbox = nothing
  response.write "旧密码输入错误!"
  end if
response.end 

%>
</td>
  </tr>
</table>
</BODY>
</HTML>

3.登陆验证(ASP):
dim rbox
set rbox = Server.CreateObject("RbsBoxGen.NTUserManager")
'以下如果已在DLL的初始化事件中设置正确则无须设置,可提高安全性
'rbox.Domain="yourdomain"
'rbox.Admin="administrator"
'rbox.password="XXXXXX"
'rbox.Ntserver="yonrntserver"
'rbox.EmailAddress="@Xxx.xxx"
'rbox.ExchServer="yourExchangeServerName"
'rbox.ExchSite="yourExchangeSiteName"
'rbox.ExchOrganization="yourExchangeOrganizationName"


rbox.Login name,pass  'name:待验证的用户帐号,Pass:用户密码
Login=cbool(rbox.isok)  '如果rbox.isok为真,验证通过.
set rbox = nothing
if Not Login then
  response.redirect Request.ServerVariables("HTTP_REFERER")
  response.end
end if

上一页  [1] [2] [3] [4] [5] 






  • 上一篇文章:
  • 下一篇文章:
  • 分享此文:该页面添加到 Mister Wong 添加到雅虎Yahoo!收藏 Add to:Del.icio.us Post to Furl Digg this 添加到Google书签 reddit spurl blogmarks 365Key 评论  收藏  分享  打印
     我来说两句
    姓名:       验证码:   
    主页: 
    评分: 1分 2分 3分 4分 5分
    本频道近期热评文章:
      关于我们 | 联系我们 | 站点地图 | 广告投放 | 友情链接 | 在线留言 | 版权申明
    版权所有 © 2004-2007 顶尖设计(bobd.cn)
    未经授权禁止转载,摘编,复制本站内容或建立镜像. 沪ICP备07504942号 
    网络110
    报警服务