線上即時開通FTPWEB

來源:互聯網
上載者:User

程式利用FSO+SERV-U(2.x版本)實現:

1、index.htm

<html>

<head>

<title>寧波科宇網——個人網頁申請</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script language="Javascript">

function CheckIfEnglish( String )

{

var Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-";

var i;

var c;

if(String.charAt( 0 )==''''-'''')

return false;

if( String.charAt( String.length - 1 ) == ''''-'''' )

return false;

for( i = 0; i < String.length; i ++ )

{

c = String.charAt( i );

if (Letters.indexOf( c ) < 0)

return false;

}

return true;

}

function checkSubmit() {

var EmailReg = /^[_a-z0-9]+@([_a-z0-9]+\.)+[a-z0-9]{2,3}$/;

if (document.form.name.value == "") {

alert("請輸入您要註冊的使用者名稱!");

document.form.name.focus();

return false;

}

if (!CheckIfEnglish(document.form.name.value )) {

alert("使用者名稱不能輸入中文及非法字元!");

document.form.name.focus();

return false;

}

if ((document.form.pass.value == "")&&(document.form.rpass.value == "")) {

alert("密碼不可為空!");

document.form.pass.focus();

document.form.rpass.focus();

return false;

}

if ((document.form.pass.value)!=(document.form.rpass.value)) {

alert (''''二次密碼輸入不一樣!'''');

document.form.pass.focus();

document.form.rpass.focus();

return false;

}

if (document.form.email.value == "") {

alert("請輸入您的Email!");

document.form.email.focus();

return false;

}

if ((!EmailReg.test(document.form.email.value))&&(document.form.email.value!='''''''')) {

alert (''''Email的格式不正確!'''');

document.form.email.focus();

return false;

}

return true;

}

</script>

<script language="JavaScript">

<!--

function MM_reloadPage(init) { //reloads the window if Nav4 resized

if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

}

MM_reloadPage(true);

// -->

</script>

</head>

<body bgcolor="#FFFFFF" text="#000000" background="crystal.jpg">

<p align="center"> </p>

<p align="center"><b><font size="6" color="#333333">寧波科宇網——個人網頁申請</font></b></p>

<p align="center"></p>

<table width="65%" border="0" align="center">

<tr>

<td>

<form name="form" method="post" action="page.asp">

<p><b>使用者名稱稱:</b>

<input type="text" name="name" size="10" class="form">

*

注意:使用者名稱只能由英文字母(a-z、A-Z),數字(0-9)構成,不能有空格。

<b>密  碼:</b>

<input type="password" name="pass" size="10" class="form">

*</p>

<p><b>確認密碼:</b>

<input type="password" name="rpass" size="10" class="form">

*(確認上面的密碼)</p>

<p><b>您的MAIL:</b>

<input type="text" name="email" size="20" class="form">*(請正確填寫)

</p>

<p>

<input type="submit" name="Submit" value="提交" onClick ="java script:return checkSubmit()">

<input type="reset" name="Submit2" value="重寫">

其中*號項目為必填項目!</p>

</form>

</td>

</tr>

</table>

<p align="center"><font color="#FF0000">注意:本空間可以安裝BBS論壇,嚴格禁止江湖、聊天室等嚴重佔用資源的程式運行。

一經發現,刪除全部程式及FTP帳號,並不於通知!</font></p>

<p align="center"> </p>

<p align="center">-==<a href="mailto:support@4email.vicp.net">寧波科宇網</a>==-

CopyRight By KeYu Computer WorkRoom 2001-2002</p>

</body>

</html>

2、後台控制檔案page.asp

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</head>

<body bgcolor="#FFFFFF" text="#000000">

<%vname=request("name")

vpass=request("pass")

vrpass=request("rpass")

vemail=request("email")

%>

<%

if request.form("name")="" then

response.write "錯誤提示:請輸入使用者名稱!"

response.end

end if

if request.form("pass")="" then

response.write "錯誤提示:請輸入口令!"

response.end

end if

if request.form("pass")<>request.form("rpass") then

response.write "錯誤提示:兩次口令不相符!"

response.end

end if

if request.form("email")="" then

response.write "錯誤提示:必須輸入你的正確EMAIL!"

response.end

end if

%>

<%set myconn=server.createobject("ADODB.CONNECTION")

dbpath=server.mappath("db.mdb")

myconn.open "driver={Microsoft access driver (*.mdb)};dbq="&dbpath

SQL="select * from hostname where 使用者名稱=''''"&vname&"''''"

set list=myconn.execute(sql)

%>

<% if list.eof then%>

<%

set rs=server.createobject("ADODB.RecordSet")

rs.Open "hostname", myconn, adOpenDynamic, 3

rs.addnew

rs("使用者名稱")=vname

rs("密碼")=vpass

rs("郵箱")=vemail

rs.update

rs.close

Set myfileobject=server.createobject("scripting.filesystemobject")

myfileobject.createfolder("e:\club\"&vname)

set afile=myfileobject.getfile("e:\club\person.htm")

afile.copy "e:\club\"&vname&"\index.htm"

set afile=myfileobject.getfile("e:\club\line113.gif")

afile.copy "e:\club\"&vname&"\line113.gif"

set afile=myfileobject.getfile("e:\club\bg11.gif")

afile.copy "e:\club\"&vname&"\bg11.gif"

set afile=myfileobject.getfile("e:\club\c24.gif")

afile.copy "e:\club\"&vname&"\c24.gif"

set mytextfile=myfileobject.opentextfile("C:\Program Files\serv-u\Serv-u.ini",8)

mytextfile.writeline("[USER="&vname&"]")

mytextfile.writeline("password="&vpass)

mytextfile.writeline("HomeDir=e:\club\"&vname)

mytextfile.writeline("RelPaths=YES")

mytextfile.writeline("ChangePassword=YES")

mytextfile.writeline("SpeedLimit=20480")

mytextfile.writeline("QuotaEnable=YES")

mytextfile.writeline("QuotaMaxCurrent=20971520,0")

mytextfile.writeline("TimeOut=600")

mytextfile.writeline("Access1=e:\club\"&vname&",RWAMCDLP")

Response.Redirect "welcome.htm"

response.end

%>

<%else%>

<center>對不起,您的使用者名稱<%=vname%>已被他人所用,請您換一個使用者名稱申請<P><a href="./">返回申請頁面</a></p></center>

<%end if%>

</body>

</html>

3、註冊成功頁面welcome.htm

<html>

<head>

<title>OK</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</head>

<body bgcolor="#FFFFFF" text="#000000" background="bg14.jpg">

<p align="center"><b><font color="#FF0000" size="7">恭喜您</font></b></p>

<p align="center"><img border="0" src="line761.gif" width="560" height="18"></p>

<p align="center"></p>

<p align="center">您已成功地申請了自己的個人首頁</p>

<p></p><table width="451" border="0" align="center">

<tr>

<td width="443"><b>請您閱讀以下注意事項:</b></td>

</tr>

<tr>

<td width="443">1、您的首頁空間是20M,支援ASP,暫不支援CGI,請您及時上傳您的首頁,超過三周不上傳者,我們將刪除您的帳號!</td>

</tr>

<tr>

<td width="443">2、本站支援FTP登入、支援斷點續傳,可以用各種FTP工具來上傳您的檔案。</td>

</tr>

<tr>

<td width="443">3、本站個人首頁的FTP地址為<b><font color="#FF0000">cn4e.vicp.net</font></b></td>

</tr>

<tr>

<td width="443">4、訪問路徑是<b><font color="#FF0000">http://cn4e.vicp.net/您的使用者名稱</font></b></td>

</tr>

<tr>

<td width="443">5、如有任何疑問,請致信<a href="mailto:support@4email.vicp.net">support@4email.vicp.net</a></td>

</tr>

</table>

<p align="center"><a href="http://www.kydn.com">寧波科宇網</a>

<p align="center"><a href="/">返回首頁</a></p>

<p align="center"><img src="line738.gif" width="500" height="24"></p>

<p align="center"></p>

</body>

</html>

4、預設首頁檔案person.htm

<html>

<head>

<title>個人網站</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</head>

<body bgcolor="#FFFFFF" text="#000000" background="bg11.gif">

<p align="center"> </p>

<p align="center"><b><font size="6">個人網頁</font></b></p>

<p align="center"><img border="0" src="c24.gif" width="96" height="66"></p>

<p align="center">正在施工中。。。。。</p>

<p align="center"><img border="0" src="line113.gif" width="420" height="11"></p>

<p align="center">-==<a href="http://www.kydn.com">寧波科宇網</a>==-

CopyRight By KeYu Computer WorkRoom 2001-2002</p>

</body>

</html>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.