首页 域名主机 文章教程 汽车频道 酷车图集 博客之家 网址之家 资源下载 在线音乐 本站论坛
  你现在的位置:首页>>文章教程>>网页编程>>ASP教程>>正文
 
产生密码,记录到数据库,然后发送给用户。
 
[2005-3-24] 来源: 作者:分享吧收集整理  爱我梅州商务网 
 

This article Generates a password random, Requires a database and Mails the Password.

<%@language="vbscript" %>

******************************
<%
'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.
 
上一篇文章:NET移植案例学习:建造Web站点(1)
下一篇文章:如何读出空格
本文章为原作者版权所有,如有侵犯您的权益请通知我们,我们会在24小时以内删除
最新5篇热点文章
最新5篇推荐文章
相关文章

关于我们 | 广告刊登 | 合作伙伴 | 友情链接 | 意见反馈 | 帮助HELP| 网站地图

版权所有 Copyright © 2002-2005 爱我梅州商务网
粤ICP备05105236号