快精灵印艺坊 您身边的文印专家
广州名片 深圳名片 会员卡 贵宾卡 印刷 设计教程
产品展示 在线订购 会员中心 产品模板 设计指南 在线编辑
 首页 名片设计   CorelDRAW   Illustrator   AuotoCAD   Painter   其他软件   Photoshop   Fireworks   Flash  

 » 彩色名片
 » PVC卡
 » 彩色磁性卡
 » 彩页/画册
 » 个性印务
 » 彩色不干胶
 » 明信片
   » 明信片
   » 彩色书签
   » 门挂
 » 其他产品与服务
   » 创业锦囊
   » 办公用品
     » 信封、信纸
     » 便签纸、斜面纸砖
     » 无碳复印纸
   » 海报
   » 大篇幅印刷
     » KT板
     » 海报
     » 横幅

产生密码,记录到数据库,然后发送给用户。

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.

返回类别: 教程
上一教程: ASP系列讲座(二十三)编写跨平台应用程序
下一教程: 亲密接触ASP.Net(12)

您可以阅读与"产生密码,记录到数据库,然后发送给用户。"相关的教程:
· 产生密码,记录到数据库,然后发送给用户
· 产生一个密码,并记录到数据库,然后发送给用户
· 将数据库数据读出到DATAGRID然后保存到EXCEL中
· 对数据库中的记录用上一条下一条显示(三)
· 上传图片以二进制插入到数据库,且读取显示
    微笑服务 优质保证 索取样品