文件過瀘!
各位我是從服務器的文件夾下讀取圖片文件的,我現在想在ASP下過瀘這些文件,不是圖片文件的就不顯示出來,請問各位有什麼好招嗎?
另外我還有一個問題:我想在ASP裡做出一種像VB裡面的LISTBO控件一樣的效裡,不知道各位有什麼好招嗎?我試了一下始終他是顯示一行,請各位幫我看一下這 段代碼問題出在哪:
s=request( "sel ")
smappath=serverpath& "\ "&s
'response.Write "這個文件夾下共有: "&i& "個圖片文件 "
set objfolder=objfso.getfolder(smappath)
'response.Write " <table width= '100% '> <tr> "
response.Write( " <select name= " "select " " size= " "5 " " multiple style= " "max-height:inherit " "> " )
for each objFile in objfolder.files
i=i+1
imgname=sMapPath & "\ " & objFile.Name
response.Write ( " <option value= "&imgname& "> "&objfile.name& " </option> ")
next
response.Write( " </select> ")
謝謝!
------解决方案--------------------在for each objFile in objfolder.files后加入:
select case LCase(objFile.Ext) '取出扩展名
case "jpg ", "jpeg ", "png ", "gif ", "bmp "
case else
exit for
end select