[mrtg] code update: rename mrtg asp script
David Eshelman
deshelman at crawford.com
Fri Apr 27 22:02:46 MEST 2001
<%@ Language=VBScript %>
<% response.buffer=true %>
<%
' Revision 1.2
'Removed Unnecessary Variables. Closed FSO connection (I always forget).
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Dim strRootFolder
strRootFolder = Request.ServerVariables("PATH_TRANSLATED")
strRootFolder = Lcase(Left(strRootFolder, instrRev(strRootFolder,"\")))
Dim objFolder
Set objFolder = objFSO.GetFolder(strRootFolder)
Set fc = objFolder.Files
set objFSO = Nothing
Dim File, strPath, strExtension
'Iterate through each file in the folder
For Each File in fc
'Obtain the extension of the current file
strPath = File.Path
strExtension = Ucase(Right(strPath, Len(strPath) - _
InStrRev(strPath, ".")))
If strExtension = "HTM" then
response.redirect(File.Name)
elseif strExtension = "HTML" then
response.redirect(File.Name)
end if
next
response.write("No Files Exist!!!")
%>
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://www.ee.ethz.ch/~slist/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the mrtg
mailing list