Private Sub scan(a As String)
Dim filename As String
Dim nd As Integer
Dim fold() As String
Dim n As Integer
filename = Dir(a)
Do While filename <> ""
Label2.Caption = LCase(Right(filename, 3))
If LCase(Right(filename, 3)) = "swf" Then
List1.AddItem (a & filename)
End If
filename = Dir
Loop
filename = Dir(a, vbDirectory)
Do While filename <> ""
If filename <> "." And filename <> ".." Then
If GetAttr(a & filename) = vbDirectory Then
nd = nd + 1
ReDim Preserve fold(nd)
fold(nd) = a & filename
End If
End If
filename = Dir
DoEvents
Loop
For n = 1 To nd
scan fold(n) & "\"
Next
End SubPrivate Sub scan1_Click()
Dim urltmp As String
Dim url
Dim yp As String
Dim ie As String
Dim ver As String
Dim cache As String
List1.Clear
ver = getver
Label2.Caption = ver
If yingpan1.Value = True And ie1.Value = True Then
If ie1.Value = True Then
If ver = "Windows 95" Or ver = "Windows 98" Or ver = "Windows Mellinnium" Then
ie = getdir + "Temporary Internet Files" + "\"
Else
If ver = "Windows 2000" Or ver = "Windows XP" Then
cache = getname
ie = getdir + cache + "\" + "Local Settings" + "\" + "Temporary Internet"
scan (ie)
End If
End If
Else
If yingpan1.Value = True Then
If Right(Dir1.Path, 1) = "\" Then
yp = Left(Dir1.Path, 2)
Else
yp = Dir1.Path
scan yp & "\"
End If
End If
End If
End If其中getdir是得到windows的目录,getname是得到用户名 getver是得到版本
我想用它来实现搜索硬盘上的swf文件和IE缓存的swf文件