以下是W3学校的一个简单示例:
dim fs
strFilePath = "http://lanswinweb1/assembly/scrollingimages/images/" & Session("Num") & ".jpg"
'strFilePath = "P:\Assembly\Team Performance Boards\LDT Scrolling Monitor\" & Session("Num") & ".jpg"
set fs=Server.CreateObject("Scripting.FileSystemObject")
if fs.FileExists(strFilePath) then
Session("Num") = Session("Num") + 1
response.write("File: " & strFilePath & " exists!")
else
response.write("File: " & strFilePath & " does not exist!")
end if
set fs=nothing
这给了我:
那么,我错过了什么或做错了什么?
答案 0 :(得分:1)
谢谢@Lankymart的帮助!
strFilePath = Server.MapPath(".") & "\images\1.jpg"
解决它!