<%
Function ReverseMap(path)
Dim mapArray(3,1)
mapArray(0,0) = "/samples"
mapArray(0,1) = "C:\myotherwebpage\samples\"
mapArray(1,0) = "/other"
mapArray(1,1) = "X:\intranetpages\securedpages\"
mapArray(2,0) = "/books"
mapArray(2,1) = "C:\Inetpub\[URL unfurl="true"]wwwroot\homepage\books\"[/URL]
mapArray(3,0) = ""
mapArray(3,1) = "C:\Inetpub\[URL unfurl="true"]wwwroot\"[/URL]
Dim check, i
i = 0
Do While check = false AND i <= UBound(mapArray)
If InStr(path,mapArray(i,1)) Then
ReverseMap = mapArray(i,0) & "/" & Replace(right(path,(len(path) - len(mapArray(i,1)))),"\","/")
check = true
End If
i = i + 1
Loop
If check = false Then ReverseMap = "No Path Found"
End Function
Response.Write ReverseMap("X:\intranetpages\securedpages\test.asp") & "<BR>"
Response.Write ReverseMap("C:\myotherwebpage\samples\library\overduebooks.html") & "<BR>"
Response.Write ReverseMap("C:\Inetpub\[URL unfurl="true"]wwwroot\homepage\books\mybooks.asp")[/URL] & "<BR>"
Response.Write ReverseMap("C:\Inetpub\[URL unfurl="true"]wwwroot\newhomepage\books\mybooks.asp")[/URL] & "<BR>"
%>