在线实时开通FTP&WEB
程序员文章站
2022-08-06 10:46:12
程序利用fso+serv-u(2.x版本)实现:
1、index.htm
宁波科宇网—...
程序利用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>
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>
上一篇: 硬盘文件搜索代码(ASP类)