|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
使用filesystemobject,可以对服务器上的文件进行操作,浏览、复制、移动、删除等。有ado的支持,asp对数据库的操作非常得心应手。你甚至可以像使用本地数据库那样,管理远程主机上的数据库,对表格、记录进行各种操作。数据|数据库ThisarticleGeneratesapasswordrandom,RequiresadatabaseandMailsthePassword.
<%@language="vbscript"%>
******************************
<%
codebyManikantan
WebDeveloper
3rdAgenda
Nungambakkam,ChennaiIndia
%>
<%
setmail=server.CreateObject("cdonts.newmail")
mail.subject="ThankYouforRegistering"
mail.to=mailidmail.from="Webmaster@thesite"
mail.body="ThisistheInitialPasswordtooursite...."&vbcrlf
&href=mailto:mailid="user@ursite.com>mailid="user@ursite.com"
address="address"
otherdatalikephonenumberasperthememberdatabaseinthesite
allthesevaluesareobtainedfromtherequestmethodfroma.htmwhichsubmitstothisfile
Mainlyemployedinregistration
AssumesYouhavecdonts.dllinstalledinthewebserver.
setconn=server.CreateObject("adodb.connection")
conn.Open"dsn","uid","pwd"
setrec=conn.Execute("selectcount(*)frommembertable")
id=cint(rec.fields(0))+1
r=rnd*50
Response.Writer&"<br>"
fori=0to20
ifcint(r)>0andcint(r)<26thenstr=str+chr(97+cint(r))
r=rnd*100
next
Response.Writestr
pwd=left(str,2)
pwd=pwd&id
pwd=pwd&right(str,2)
pwd=pwd&second(time)
AnUpdateQuerycanbePassedfromherefortheusername,passwordandotherdetailsorcanbetriggered
fromanotherpagewhentheuserrespondstothemail...Somethinglikesendingaurlasamailandon
clickoftheurlinthemail..callanotherpagewhichupdates..sowecanbesurethatonlyconfirmed
usersareupdated
%>
<br>
<%
setmail=server.CreateObject("cdonts.newmail")
mail.subject="ThankYouforRegistering"
mail.to=mailid
mail.from="Webmaster@thesite"
mail.body="ThisistheInitialPasswordtooursite...."&vbcrlf&"ChangeitifYouWant"&vbcrlf&
pwd&vbcrlf&"ThankYouforUsingtheSite"
mail.send
%>
TheNewPasswordhasbeenMailed.
******************************
Regards
VedachalamManikantan
</p>asp对于服务器的要求较高,一般的服务器如果访问量一大就垮了,不得不重启。 |
|