源代码:
<% Set fs=Server.CreateObject("Scripting.FileSystemObject") if fs.driveexists("c:") = true then Response.Write("Drive c: exists.") Else Response.Write("Drive c: does not exist.") End If Response.write("
") if fs.driveexists("g:") = true then Response.Write("Drive g: exists.") Else Response.Write("Drive g: does not exist.") End If set fs=nothing %>
运行结果:
<% Set fs=Server.CreateObject("Scripting.FileSystemObject") if fs.driveexists("c:") = true then Response.Write("Drive c: exists.") Else Response.Write("Drive c: does not exist.") End If Response.write("
") if fs.driveexists("g:") = true then Response.Write("Drive g: exists.") Else Response.Write("Drive g: does not exist.") End If set fs=nothing %>