[摘要]"&RebelEnd IfElseIf (List=0 AND Chk =0) OR (List=1 And Chk=-1) Or (List=2 And Chk=1 ) Or L...
"&Rebel
End If
Else
If (List=0 AND Chk =0) OR (List=1 And Chk=-1) Or (List=2 And Chk=1 ) Or List=3 Then
Set TheFile= New FileInfo
TheFile.FileName=ReImg
TheFile.Belong=ReBel
TheFile.Exists=Chk
File.Add ReImg,TheFile
Select Case ScanType
Case 1 Images=Images+1
Case 2 DbImg = DbImg+1
Case Else
If AddNum = 0 Then
DbImg = DbImg+1
Else
Images=Images+1
End If
End Select
End If
End If
End Sub
Private Function GetPath(Str) '获得文件路径
'response.write str&"<br>"
Dim Temp,EndB
Temp=Replace(Str,"/","\")
EndB=InstrRev(Temp,"\")
If EndB = 0 Then
GetPath=SPath
Else
GetPath=Left(Temp,EndB)
End If
'response.write GetPath&"<BR>"
End Function
Private Function GetFn(Str) '获得文件的相对路径名
Dim Temp
Temp=Str
'response.write temp&"<br>"
Temp=Replace(Str,SPath,"")
Temp=Replace(Temp,"\","/")
GetFn=Temp
End Function
End Class
Class FileInfo
Dim FileName,Belong,Exists
Private Sub Class_Initialize
FileName=""
Belong=""
Exists=""
End sub
End Class
%>
应用举例
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link rel="stylesheet" href="css.css">
</head>
<body>
<form name="form1" method="post" action="scan.asp">
<table width="60%" border="0" align="center" cellspacing="1" bgcolor="#003366">
<tr bgcolor="#FFFFFF">
<td height="30" colspan="2" bgcolor="#00CCFF"><div align="center">扫描图片</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="26%" height="20"><div align="right">扫描文件夹:</div></td>
<td width="74%" height="20"><select name="Path" id="Path">
<option value="/">/</option>
<%
dim fso,f,fd,p
p=server.MapPath("/")
set fso=Server.CreateObject("Scripting.FileSystemObject")
function showpath(str)
set f=fso.getfolder(str)
set fd=f.subfolders
for each fds in fd
Response.Write "<option value="&Replace(Replace(fds,p,""),"\","/")&">"&Replace(Replace(fds,p,""),"\","/")&"</option>"
set ff=fso.getfolder(fds)
set ffd=ff.subfolders
if ffd.count>0 then
showpath(fds)
end if
next
end function
showpath(p)%>
</select></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20"><div align="right">扫描类型:</div></td>
<td height="20"><input type="radio" name="SType" value="0">
所有
<input name="SType" type="radio" value="1" checked>
扫描文件
<input type="radio" name="SType" value="2">
扫描数据库</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20"><div align="right">显示类型:</div></td>
<td height="20"><input name="LType" type="radio" value="0" checked>
失效
<input type="radio" name="LType" value="1">
网络路径
<input type="radio" name="LType" value="2">
有效
<input type="radio" name="LType" value="3">
所有</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20"><div align="right">文件类型:</div></td>
<td height="20"><input name="Ext" type="checkbox" id="Ext" value="asp" checked>
Asp
<input name="Ext" type="checkbox" id="Ext" value="htm" checked>
Htm
<input name="Ext" type="checkbox" id="Ext" value="html" checked>
Html
<input name="Ext" type="checkbox" id="Ext" value="inc" checked>
Inc</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="20"><div align="right">数据库:</div></td>
<td height="20">表:
<input name="Tab" type="text" id="Tab" size="5" class="allinput">
图片ID列:
<input name="ColID" type="text" id="ColID" size="5" class="allinput">
图片路径列:
<input name="ColImg" type="text" id="ColImg" size="5" class="allinput"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="40" colspan="2"><div align="center">
<input type="submit" value=" 开始扫描 " class="allinput">
</div></td>
</tr>
</table>
</form>
</body>
</html>
scan.asp
<!--#include file="scan.inc"-->
<%
dim mcs,fn,fb
%>
<link href="css.css" rel="stylesheet">
<table width="70%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#003366">
<tr bgcolor="#AAAAFF">
<td width="30%" height="30">图片名称</td>
<td width="39%" height="30">所在位置</td>
<td width="31%" height="30">有效</td>
</tr>
<%
Function GetVar(ID,Default)
GetVar = Default
If Request(ID) <> "" Then
GetVar = Request(ID)
End IF
End Function
Dim SType,LType,Path,Ext,Conn,Tab,ColID,ColImg
SType=GetVar("SType",1)
LType=GetVar("LType",3)
Path=GetVar("Path","/")
Ext = Trim(Replace(GetVar("Ext","htm,html,asp,inc"),", ","/"))
Conn=GetVar("Conn","")
Tab=GetVar("Tab","")
ColID=GetVar("ColID","")
ColImg=GetVar("ColImg","")
Conn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("/db1.mdb")
set mcs= new mcscanimg
mcs.ScanType=SType
mcs.list=LType
mcs.ScanText=Ext
mcs.conn=Conn
mcs.Path=Path
mcs.table=Tab
mcs.ColID=ColID
mcs.ColImg=ColImg
mcs.scan()
for each fn in mcs.file
set fb=mcs.file(fn)
%>
<tr bgcolor="#FFFFFF">
<td valign="top"><%=fb.filename%></td>
<td><%=Replace(fb.Belong,"
关键词:网站图片扫描类