打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
产生密码,记录到数据库,然后发送给用户
userphoto

2010.05.12

关注
This article Generates a password random, Requires a database and Mails the Password.
******************************
<%
'code by Manikantan
'Web Developer
'3rd Agenda
'Nungambakkam, Chennai India
%>
<%
set mail= server.CreateObject("cdonts.newmail")
mail.subject="Thank You for Registering"
mail.to = mailid mail.from ="Webmaster@thesite"
mail.body= "This is the Initial Password to our site...." & vbcrlf
&href='mailto:mailid="user@ursite.com'>mailid="user@ursite.com"
address="address"

'other data like phone number as per the member database in the site
'all these values are obtained from the request method from a .htm which submits to this file
'Mainly employed in registration
'Assumes You have cdonts.dll installed in the web server.
set conn = server.CreateObject("adodb.connection")
conn.Open "dsn","uid","pwd"
set rec= conn.Execute("select count(*) from membertable")
id = cint(rec.fields(0))+1
r=rnd *50
Response.Write r & "<br>"
for i = 0 to 20
    if cint(r)>0 and cint(r)<26 then str=str +chr(97 + cint(r))
    r=rnd *100
next
Response.Write str
pwd=left(str,2)
pwd=pwd & id
pwd=pwd & right(str,2)
pwd=pwd & second(time)
'An Update Query can be Passed from here for the username ,password and other details or can be triggered
from another page 'when the user responds to the mail...Something like sending a url as a mail and on
click of the url in the mail..call another page 'which updates ..so we can be sure that only confirmed
users are updated
%>
<br>
<%
set mail= server.CreateObject("cdonts.newmail")
mail.subject="Thank You for Registering"
mail.to = mailid
mail.from ="Webmaster@thesite"
mail.body= "This is the Initial Password to our site...." & vbcrlf & "Change it if You Want" & vbcrlf &
pwd & vbcrlf & "Thank You for Using the Site"
mail.send
%>

The New Pass word has been Mailed.
资料引用:http://www.knowsky.com/2279.html
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Server 对象 错误 'ASP 0177 : 800401f3'解决方法 - 禹铭的日...
留言簿自动发E-Mail
ASP与数据库应用(给初学者
在ASP中使用Oracle数据库
使用VB将ASP代码封装生成DLL文件
VBS采集:抓取一本电子书
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服