国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 網(wǎng)站 > 建站經(jīng)驗(yàn) > 正文

如何用ASP代碼實(shí)現(xiàn),虛擬主機(jī)

2019-11-02 14:14:03
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

  以下是創(chuàng)建一個(gè)虛擬主機(jī)的代碼:

config.xml(配置信息)

<Root_Element>
<admin>Administrator</admin>
<adminpass>xxxxxx</adminpass>
<readuser>IUSR_MACHINE</readuser>
<domain>cocoo.net</domain>
<dnsadmin>dnsadmin</dnsadmin>
<dnsadminpass>yyyyy</dnsadminpass>
<dnsip>10.1.143.227</dnsip>
<group>tryit</group>
<webdir>http://hanhong.cocoo.net</webdir>
</Root_Element>


global.asa(配置文件)

<SCRIPT LANGUAGE=vbscript RUNAT=Server> 
Sub Application_OnStart
set ff=server.createobject("microsoft.xmldom")
ff.async=false
ff.load server.mappath("config.xml")
set rootElem = ff.documentElement 
for e1=0 to rootElem.childNodes.length-1 
application(trim(rootElem.childNodes.item(e1).nodeName))=trim(rootElem.childNodes.item(e1).text)
next
End Sub
</script>


index.asp(申請(qǐng)頁(yè)面)

<% 
user=trim(request("user"))
pass=trim(request("pass"))
email=trim(request("email"))
if user<>"" then
if pass="" or instr(email,"@")<2 then
response.write "<font color='red'>填寫(xiě)錯(cuò)誤</font>"
else
SET GG=SERVER.CREATEOBJECT("QWEB.USER")
gg.logon application("admin") & "@" & application("domain"),application("adminpass")
SET RR=GG.CREATE(user,application("group"))
if gg.iserr then
response.write "<font color='red'>不能創(chuàng)建用戶(hù):" & gg.errstring & "</font>"
else
gg.value("pwdLastSet",rr)=-1
gg.changepassword "", pass,rr
response.write gg.errstring
gg.value("accountdisabled",rr)=TRUE
gg.value("accountexpirationdate",rr)=now()+2
gg.value("description",rr)=session.SessionID
SET FF=CreateObject("QWEB.dns")
domainn=right(email,len(email)-instr(email,"@"))
SET cc=CREATEOBJECT("qmail.newmail")
cc.sender="AA網(wǎng)絡(luò)<[email protected]>"
cc.receiver=email
cc.sendashtml=true
cc.subject="注冊(cè)確認(rèn)"
cc.body="<a href='" & application("webdir") & "/active.asp?user=" & user & "&id=" & session.SessionID & "&pass=" & pass & "'>謝謝您的注冊(cè),請(qǐng)?jiān)?4小時(shí)內(nèi)(" & (now()+1) & ")激活您的帳戶(hù)。</a>"
vv=ff.mxrecord(application("dnsip"),domainn)
HH=SPLIT(VV," ")
FOR G=0 TO UBOUND(HH)
cc.smtpsvr=hh(g)
cc.send
if cc.errcode=true then exit for
next
if cc.errcode=false then
gg.delete rr
response.write "<font color='red'>無(wú)法發(fā)送注冊(cè)信息</font>"

發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 仁布县| 公主岭市| 襄汾县| 双峰县| 资兴市| 北碚区| 镇平县| 岳阳县| 天峻县| 抚松县| 吉水县| 刚察县| 横峰县| 富川| 屯昌县| 安西县| 乌鲁木齐市| 湘阴县| 呈贡县| 开化县| 大埔区| 惠东县| 重庆市| 滕州市| 桃园市| 大新县| 牟定县| 宝应县| 余干县| 连江县| 三穗县| 嘉兴市| 名山县| 东至县| 射洪县| 江北区| 皋兰县| 林西县| 和林格尔县| 邹平县| 石河子市|