誰かが私を助けることができるかどうか疑問に思っています。
次の URL があります (これは動的です)。
www.website.com/images/gal/boxes-pic004.asp
従来の ASP を使用して「boxes-pic004」部分を抽出するにはどうすればよいですか
ありがとう
誰かが私を助けることができるかどうか疑問に思っています。
次の URL があります (これは動的です)。
www.website.com/images/gal/boxes-pic004.asp
従来の ASP を使用して「boxes-pic004」部分を抽出するにはどうすればよいですか
ありがとう
<%
Dim sScriptLocation, sScriptName, iScriptLength, iLastSlash
sScriptLocation = Request.ServerVariables("URL")
iLastSlash = InStrRev(sScriptLocation, "/")
iScriptLength = Len(sScriptLocation)
sScriptName = Right(sScriptLocation, iScriptLength - iLastSlash)
%>
sScriptName
が含まれているboxes-pic004.asp
場合は、 を使用Replace(sScriptName, ".asp", "")
して拡張子を削除することもできます。
単純
使用Request.ServerVariables("SCRIPT_NAME")
してから、必要なものを取得するために文字列のチョッピングを行うだけです。