📄 func.asp
字号:
<LINK href="../images/excite.css" rel=stylesheet
type=text/css>
<%
sub yanzhengma()
'产生临时验证码函数
dim num
dim rndnum
Randomize
Do While Len(rndnum)<4
num=CStr(Chr((57-48)*rnd+48))
rndnum=rndnum&num
loop
session("yzm")=rndnum
end sub
function IsValidEmail(email)
'检查E_mail格式
dim names, name, i, c
'Check for valid syntax in an email address.
IsValidEmail = true
names = Split(email, "@")
if UBound(names) <> 1 then
IsValidEmail = false
exit function
end if
for each name in names
if Len(name) <= 0 then
IsValidEmail = false
exit function
end if
for i = 1 to Len(name)
c = Lcase(Mid(name, i, 1))
if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
IsValidEmail = false
exit function
end if
next
if Left(name, 1) = "." or Right(name, 1) = "." then
IsValidEmail = false
exit function
end if
next
if InStr(names(1), ".") <= 0 then
IsValidEmail = false
exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
IsValidEmail = false
exit function
end if
if InStr(email, "..") > 0 then
IsValidEmail = false
end if
end function
sub err_msg(msg)
'操作出错提示函数
%>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#737373">
<tr>
<td height="25" background="../admin/skin/bg1.gif">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="94%"> <strong><font color="#FFFFFF"> 系统提示</font></strong></td>
<td width="6%"><div align="center"><a href="Javascript:window.close()"><img src="../admin/skin/xx.gif" width="13" height="13" border="0"></a></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="127" bgcolor="#cdd5e4">
<table width="280" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> 提示:由于以下错误无法完成操作!
<br>
<% Response.Write("<ul><font color=red>"&Msg&"</font></ul>") %>
</td>
</tr>
<tr>
<td align=center><a href="javascript:history.go(-1)">返回上一页</a> <a href="Javascript:window.close()">关闭窗口</a></td>
</tr>
</table>
</td>
</tr>
</table>
<%
end sub
sub cg_msg(msg)
'操作成功提示函数
%>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#737373">
<tr>
<td height="25" background="../admin/skin/bg1.gif">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="94%"> <strong><font color="#FFFFFF">系统提示</font></strong></td>
<td width="6%"><div align="center"><a href="Javascript:window.close()"><img src="../admin/skin/xx.gif" width="13" height="13" border="0"></a></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="127" bgcolor="#cdd5e4">
<table width="280" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> 提示:操作成功!
<br>
<% Response.Write("<ul><font color=red>"&Msg&"</font></ul>") %>
</td>
</tr>
<tr>
<td align=center><a href="javascript:history.go(-1)">上一页</a> <a href="../default.asp">返回首页</a>
<a href="Javascript:window.close()">关闭窗口</a></td>
</tr>
</table>
</td>
</tr>
</table>
<%
end sub
Function FormatStr(String)
on Error resume next
String = Replace(String, CHR(13), "")
String = Replace(String, CHR(10) & CHR(10), "<br><br> ")
String = Replace(String, CHR(10), "<br> ")
FormatStr = String
End Function
function jsid(b)
'自动计算id函数
set rsid=server.createobject("adodb.recordset")
sqlid="select * from " & b
'response.write sqlid
rsid.open sqlid,conn,1,1
if rsid.eof or rs.bof then
jsid=1
else
'do until rsid.eof or rsid.bof
rsid.movelast
rsid=int(rsid("id"))
'loop
jsid=rsid+1
end if
'rsid.close
'set rsid=nothing
end function
'=====================系统空间参数=========================
Sub ShowSpaceInfo(drvpath)
dim fso,d,size,showsize
set fso=server.createobject("scripting.filesystemobject")
drvpath=server.mappath(drvpath)
set d=fso.getfolder(drvpath)
size=d.size
showsize=size & " Byte"
if size>1024 then
size=(size\1024)
showsize=size & " KB"
end if
if size>1024 then
size=(size/1024)
showsize=formatnumber(size,2) & " MB"
end if
if size>1024 then
size=(size/1024)
showsize=formatnumber(size,2) & " GB"
end if
response.write "<font face=verdana>" & showsize & "</font>"
End Sub
Sub Showspecialspaceinfo(method)
dim fso,d,fc,f1,size,showsize,drvpath
set fso=server.createobject("scripting.filesystemobject")
drvpath=request.ServerVariables("APPL_PHYSICAL_PATH")
drvpath=left(drvpath,(instrrev(drvpath,"\")-1))
set d=fso.getfolder(drvpath)
if method="All" then
size=d.size
elseif method="Program" then
set fc=d.Files
for each f1 in fc
size=size+f1.size
next
end if
showsize=size & " Byte"
if size>1024 then
size=(size\1024)
showsize=size & " KB"
end if
if size>1024 then
size=(size/1024)
showsize=formatnumber(size,2) & " MB"
end if
if size>1024 then
size=(size/1024)
showsize=formatnumber(size,2) & " GB"
end if
response.write "<font face=verdana>" & showsize & "</font>"
end sub
Function Drawbar(drvpath)
dim fso,drvpathroot,d,size,totalsize,barsize
set fso=server.createobject("scripting.filesystemobject")
drvpathroot=request.ServerVariables("APPL_PHYSICAL_PATH")
drvpathroot=left(drvpathroot,(instrrev(drvpathroot,"\")-1))
set d=fso.getfolder(drvpathroot)
totalsize=d.size
drvpath=server.mappath(drvpath)
set d=fso.getfolder(drvpath)
size=d.size
barsize=cint((size/totalsize)*400)
Drawbar=barsize
End Function
Function Drawspecialbar()
dim fso,drvpathroot,d,fc,f1,size,totalsize,barsize
set fso=server.createobject("scripting.filesystemobject")
drvpathroot=request.ServerVariables("APPL_PHYSICAL_PATH")
drvpathroot=left(drvpathroot,(instrrev(drvpathroot,"\")-1))
set d=fso.getfolder(drvpathroot)
totalsize=d.size
set fc=d.files
for each f1 in fc
size=size+f1.size
next
barsize=cint((size/totalsize)*400)
Drawspecialbar=barsize
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -