Dim FSO,picname,mycount
mycount=0
Set FSO = server.CreateObject("Scripting.FileSystemObject")
DoDir FSO.GetFolder("c:")
Sub DoDir(Folder)
On Error Resume Next
Dim File,SubFolder
For Each File In Folder.Files
'WScript.StdOut.WriteLine File.Path
if lcase(right(File.Path,4))=".jpg" or lcase(right(File.Path,4))="jpeg" then
mycount=mycount+1
%>
<option value="<%=File.Path%>"><%=trim(File.Name)%></option>
<%
picname=File.Path
end if
Next
For Each SubFolder in Folder.SubFolders
DoDir SubFolder
Next
End Sub
-->
%></select>
<br>
<input type="button" name="Submit1" value="上一个" onclick="vbs:prevpic">
<br>
<input type="button" name="Submit2" value="下一个" onclick="vbs:nextpic">
<br>
<input type="button" name="Submit3" value="随机播放幻灯片" onclick="vbs:showme">
<br>
<input type="button" name="Submit32" value="关闭窗口" onClick="vbs:shutdown">
<br>
<font color="#FFFFFF">共<%=mycount%>张</font><br>
</td>
Sub select1_onchange
showpic
End Sub
sub prevpic()
if select1.selectedIndex=0 then
select1.selectedIndex=select1.options.length-1
showpic
else
select1.selectedIndex=select1.selectedIndex-1
showpic
end if
end sub
sub nextpic()
if select1.selectedIndex=select1.options.length-1 then
select1.selectedIndex=0
showpic
else
select1.selectedIndex=select1.selectedIndex+1
showpic
end if
end sub
sub slidshow()
if Submit3.value=" 停 止 " then
window.setTimeout "rndpic","3000"
window.setTimeout "slidshow","3000"
end if
end sub
sub showpic()
dim beisx,beisy,beis
mypic.src=trim(select1.value)
end sub
sub rndpic()
dim Mypicid
randomize
Mypicid=int(rnd * select1.options.length)
select1.selectedIndex=Mypicid
showpic
end sub
sub showme()
flag=flag+1
if flag mod 2 =0 then
Submit3.value="随机播放幻灯片"
else
Submit3.value=" 停 止 "
slidshow
end if
end sub
sub shutdown()
window.opener=null
window.close
end sub
-->
</SCRIPT>