麻烦hams版主看下
<%
Sub AllFiles(dirPath)
On Error Resume Next
if right(dirPath,1)<>"\" then dirPath=dirPath&"\"
Set FSO = CreateObject("scripting.filesystemobject")
Set f = FSO.GetFolder(dirPath)
Set fs = f.files
dim Str,Arr,a,Content,url,ShowContent
For Each fileN in fs
if
RegExpfind(".html",fileN.name) then
Str=fileN.name
response.write str
response.write "<br>"
end if
Next
Set FSO = Nothing
End sub
Function RegExpfind(patrn, strng)
Set regEx = New RegExp
regEx.Pattern = patrn
regEx.IgnoreCase = True
regEx.Global = True
RegExpfind = regEx.Test(strng)
End Function
AllFiles(server.mappath(""))
%>
以上代码可以读出所有html文件,就是不知道该添加什么代码才能做到随机读取5条
[
本帖最后由 hebss 于 2010-12-8 13:40 编辑 ]