URL、ポート、パスファイル名、パラメーターなどを取得する必要がある場合があります。ここでは、この関数コードを共有します。それを必要とする友達はそれを参照できます。
関数1
<%関数geturl()on error resume next dim strtempif lcase(request.servervariables( "https"))= "off" thenstrtemp = "https://" elsestretemp = "https://" end strtemp = strtemp&request.servervarables request.servervariables( "server_port")<> 80 then strtemp = strtemp& ":"&request.servervariables( "server_port")strtemp = strtemp&request.servervariables( "url")の場合(request.querystring)<> " &trim(request.querystring)getUrl = strtempend functionsponse.write geturl()%>
関数2
< str&host&url& "?"&keyworddelsefull = str&host&urlend ifsession( "url")= full%>
使用する場合は、HTTPS判断をサポートする最初のものを選択する必要があります。
それが404ページを介してある場合、これは取得できず、JSと組み合わせて実装する必要があります
例えば:
JSページ
<script> var pathname = window.location.pathname; location.replace( "/do.asp?p ="+pathname); </script>
処理のためにdo.aspにパスパラメーターを渡します
strpath = request( "p")
404の前にページを取得してから、操作を実行し、ディレクトリアクセス許可に注意してください。 404に入れて、操作のためにIFRAMEを罰することもできます。