中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 程序开发 > 编程语言 > LOTUS > 开发心得
注册人员(B/S)程序
作者:未知 时间:2005-07-22 13:39 出处:Lotus中文技术站 责编:chinaitpower
              摘要:注册人员(B/S)程序
Sub Initialize
 Dim session As New NotesSession
 Dim Curdb As NotesDatabase
 Dim Curdoc As NotesDocument
 Dim Tempdoc As NotesDocument
 Dim Namedb As NotesDatabase
 Dim NewDoc As NotesDocument
 Dim PeopleView As NotesView
' Dim View As NotesView
 Dim newreg As New notesregistration
 Dim success,saveok As Variant
 
 Set Curdb = session.CurrentDatabase
 Set Curdoc = session.DocumentContext
 Set Namedb = New NotesDatabase( "","names.nsf" )
 Set PeopleView = Namedb.GetView("People")
 
 PeopleView.AutoUpdate = True
 Set Tempdoc = PeopleView.GetDocumentByKey( Curdoc.CurrUserName(0),True )
 If Not( Tempdoc  Is Nothing ) Then   '用户已存在
  Print "<BODY TEXT='000000' BGCOLOR='#F5F0E6' "
  Print "<form><B><center><FONT SIZE=5 COLOR='ff0000' FACE='楷体_GB2312'>"
  Print "<br><br><br><br><br><br><br>NO!NO!<font size=6 color='00ff00'>"+"</font><br>--用户已存在!<br>"
  Print "<BR> <BR><INPUT TYPE=button onClick='history.go(-1)' VALUE='返 回'>"
  Print "<FONT FACE='仿宋_GB2312'></center></FONT></form>"
 Else  '注册用户
 
  Dim db As notesdatabase
  Set db = session.currentdatabase
  Dim certidfile As String, org As String, _
  certpw As String
  org = "TestOrg"
  length% = 2
  certidfile = "D:\Lotus\Domino\Data\pwoa\Cert.id"
  certpw = "q1w2e3r4t5"
  'newreg.RegistrationLog = "certlog.nsf"
  newreg.IDType = ID_HIERARCHICAL
  newreg.Expiration = Datevalue("December 31, 2100")
  newreg.MinPasswordLength = length%
  newreg.IsNorthAmerican = True
  newreg.CertifierIDFile = certidfile
  newreg.RegistrationServer = db.Server
  'newreg.OrgUnit = org
  newreg.CreateMailDb = True
  newreg.StoreIDInAddressBook = True
  newreg.Updateaddressbook = False
  MailFile = "Mail\"&Curdoc.CurrUserName(0)&".nsf"
  Firstname = ""
  Lastname = Curdoc.CurrUserName(0)
  RegServer = db.Server
  comment = "Comment contents"
  IDfile = "D:\Lotus\Domino\Data\pwoa\ids\"&Curdoc.CurrUserName(0)&".id"
  userPassword=Curdoc.userpass(0)
  middleinit = ""
  location = "office"
 
  Call newreg.RegisterNewUser( Lastname, IDfile, _
  RegServer, Firstname, middleinit, certpw, _
  location, comment, MailFile, "", userPassword, _
  NOTES_FULL_CLIENT )
  Call newreg.AddUserToAddressbook(IDfile, _
  Firstname & " " & Lastname, Lastname, userPassword, _
  Firstname, middleinit, RegServer, MailFile, _
  fwdaddress, location, comment )  
  Call PeopleView.Refresh
  Set PeopleView = Namedb.GetView("People")
  Set Tempdoc = PeopleView.GetDocumentByKey( Curdoc.CurrUserName(0),True )
  If Not( Tempdoc  Is Nothing ) Then   '用户存在
   TempDOC.HTTPPassword = CurDOC.userpass(0)
   TempDOC.InternetAddress=Curdoc.CurrUserName(0)&"@ddec.com.cn"
   success = TempDOC.ComputeWithForm(True,False)
   If success Then'  
    saveok = TempDOC.save(True,True)    
   End If
  End If
  Print "<BODY TEXT='000000' BGCOLOR='#F5F0E6' "
  Print "<form><B><center><FONT SIZE=5 COLOR='ff0000' FACE='楷体_GB2312'>"
  Print "<br><br><br><br><br><br><br>OK!OK!<font size=6 color='000000'>"+Curdoc.CurrUserName(0)+"</font>已经注册成功!<br>"
  Print "口令为 :<font size=5 color='000000'>"+CurDOC.userpass(0)+"</font>,请尽快通知!</FONT></B><BR> <BR><INPUT TYPE=button onClick='history.go(-2)' VALUE='返 回'>"
  Print "<FONT FACE='仿宋_GB2312'></center></FONT></form>"
 
 End If
End Sub
关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有