当前位置: 首页 > 图文教程 > 网络编程 > ASP > 产生一个密码,并记录到数据库,然后发送给用户

ASP
[原创]asp下用实现模板加载的的几种方法总结
asp下利用fso实现文件夹或文件移动改名等操作函数
asp cint clng的范围与防止cint和clng的溢出解决方法大全
asp防范跨站点脚本攻击的的方法
独孤剑写的马克斯迅雷片库采集插件1.4 官方最新版提供下载了
根据日期得到生肖的ASP函数
不错的主要用于加密的vbs(asp)位移运算类
Script.VBS.Agent.ai juan.vbs专杀
循环取值Request.QueryString的用法
asp下实现字符串的补充fill()
无服务器做任意二级米子站
几种另类的ASP后门
asp事物功能简单小应用
ASP获取网页全部图片地址并保存为数组的正则
通过客户端验证上传图片文件大小的ASP源码
asp下计算分页的几种方法
谈动态多行多列,循环行和列,输出M行N列的ASP代码
asp在线执行sql语句的函数
asp正则html的图片,对图自动缩放大小
文件名 正则表达式提取方法

ASP 中的 产生一个密码,并记录到数据库,然后发送给用户


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 125 ::
收藏到网摘: n/a

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="[email protected]'>mailid="[email protected]"
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
%>