ASP関数は、ASP Webプログラミングの実装機能の必要な部分ですが、ASP機能について知っていますか?実際、一般的に使用されるいくつかのASP機能を習得するだけでよいので、一般的に使用されるASP機能の導入を今すぐ見てみましょう。
=========ポートでURLを取得してください。==================
関数get_scriptnameurl()
request.servervariables( "server_port")= "80"の場合
get_scriptnameurl = "http://"&request.servervariables( "server_name")&lcase(request.servervariables( "script_name")))
それ以外
get_scriptnameurl = "http://"&request.servervariables( "server_name")& ":"&request.servervariables( "server_port")&lcase(request.servervariables( "script_name")))
ifを終了します
エンド関数
上記は、一般的に使用されるASP関数の紹介です。それを読んだ後、あなたはASP機能を理解していますか?
'============================================================================================================
関数BoldWord(strcontent、word)
word = "" thenの場合
boldword = strcontent
出口機能
ifを終了します
dim objregexp
objregexp = new regexpを設定します
objregexp.ignorecase = true
objregexp.global = true
objregexp.pattern = "("&word& ")"
strcontent = objregexp.replace(strcontent、 "<font color =" "#ff0000" "> <b> $ 1 </b> </font>")
objregexp =何も設定しません
boldword = strcontent
エンド関数
'=====================ユーザーの現在のIPアドレスを取得==================
関数getIp()
uip = request.servervariables( "http_x_forwarded_for")
uip = ""の場合、uip = request.servervariables( "remote_addr")
getIp = uip
エンド関数
'==================現在、現在のプログラムスクリプトパスを入手してください==================
function getScriptName()
scriptaddress = cstr(request.servervariables( "script_name")) '現在のアドレスを取得します
if(request.querystring <> "")then
scriptaddress = scriptaddress& "?" &server.htmlencode(request.querystring) 'パラメーターでアドレスを取得します
ifを終了します
len(scriptaddress)> 250の場合、scriptaddress = left(sciptaddress、250)& "..." '最大250文字でパスインターセプトを実行します
getScriptName = ScriptAddress
エンド関数
'=============== [パラメーターでURLを返します。
'Removelistパラメーター:URLから削除する必要があるパラメーターは複数になります。中央のコンマで分離してください。
機能KeepurrStr(Removelist)
scriptaddress = cstr(request.servervariables( "script_name"))& "?" '現在のアドレスを取得して "?"を追加しますシンボル
m_itemurl = ""
request.querystringの各m_itemについて
If strunt(removelist、m_item)= 0 then
m_itemurl = m_itemurl&m_item& "="&server.urlencode(request.querystring( "&m_item&" "))&"& "
ifを終了します
次
keepurlst = scriptaddress&m_itemurl
エンド関数