導航:首頁 > 文件教程 > asp獲取url文件名

asp獲取url文件名

發布時間:2024-05-29 21:02:45

A. ASP 取得網址、截取字元串(含代碼

On Error Resume Next
Dim strTemp

If LCase(Request.ServerVariables("HTTPS")) = "off" Then
strTemp = "http://"
Else
strTemp = "https://"
End If

strTemp = strTemp & Request.ServerVariables("SERVER_NAME")
If Request.ServerVariables("SERVER_PORT") <> 80 Then strTemp = strTemp & ":" & Request.ServerVariables("SERVER_PORT")

strTemp = strTemp & Request.ServerVariables("URL")

If Trim(Request.QueryString) <> "" Then strTemp = strTemp & "?" & Trim(Request.QueryString)

strTemp = LCase(strTemp)

B. asp 讀取當前頁面文件

asp 讀取當前頁面文件名參考代碼如下:
pathfilename=trim(Request.ServerVariables("SCRIPT_NAME"))
for i=len(pathfilename) to 1 step -1
if mid(pathfilename,i,1)="/" then
filename=right(pathfilename,len(pathfilename)-i)
exit for
end if
next
注意:獲取文件名:(不帶路徑)= filename。

C. 關於asp獲取當前文件名的問題

Request.ServerVariables("Url")
返回伺服器地址

Request.ServerVariables("Path_Info")
客戶端提供的路徑信息

Request.ServerVariables("Appl_Physical_Path")
與應用程序資料庫路徑相應的物理路徑

Request.ServerVariables("Path_Translated")
通過由虛擬至物理的映射後得到的路徑

Request.ServerVariables("Script_Name")
執行腳本的名稱

Request.ServerVariables("Query_String")
查詢字元串內容

Request.ServerVariables("Http_Referer")
請求的字元串內容

Request.ServerVariables("Server_Port")
接受請求的伺服器埠號

Request.ServerVariables("Remote_Addr")
發出請求的遠程主機的IP地址

Request.ServerVariables("Remote_Host")
發出請求的遠程主機名稱

Request.ServerVariables("Local_Addr")
返回接受請求的伺服器地址

Request.ServerVariables("Http_Host")
返回伺服器地址

Request.ServerVariables("Server_Name")
伺服器的主機名、DNS地址或IP地址

Request.ServerVariables("Request_Method")
提出請求的方法比如GET、HEAD、POST等等

Request.ServerVariables("Server_Port_Secure")
如果接受請求的伺服器埠為安全埠時,則為1,否則為0

Request.ServerVariables("Server_Protocol")
伺服器使用的協議的名稱和版本

Request.ServerVariables("Server_Software")
應答請求並運行網關的伺服器軟體的名稱和版本

Request.ServerVariables("All_Http")
客戶端發送的所有HTTP標頭,前綴HTTP_

Request.ServerVariables("All_Raw")
客戶端發送的所有HTTP標頭,其結果和客戶端發送時一樣,沒有前綴HTTP_

Request.ServerVariables("Appl_MD_Path")
應用程序的元資料庫路徑

Request.ServerVariables("Content_Length")
客戶端發出內容的長度

Request.ServerVariables("Https")
如果請求穿過安全通道(SSL),則返回ON如果請求來自非安全通道,則返回OFF

Request.ServerVariables("Instance_ID")
IIS實例的ID號

Request.ServerVariables("Instance_Meta_Path")
響應請求的IIS實例的元資料庫路徑

Request.ServerVariables("Http_Accept_Encoding")
返回內容如:gzip,deflate

Request.ServerVariables("Http_Accept_Language")
返回內容如:en-us

Request.ServerVariables("Http_Connection")
返回內容:Keep-Alive

Request.ServerVariables("Http_Cookie")
返回內容如:nVisiT%

2DYum=125;ASPSESSIONIDCARTQTRA=FDOBFFABJGOECBBKHKGPFIJI;ASPSESSIONIDCAQQTSRB=LKJJPLABABILLPCOGJGAMKAM;ASPSESSIONIDACRRSSRA=DK

HHHFBBJOJCCONPPHLKGHPB

Request.ServerVariables("Http_User_Agent")
返回內容:Mozilla/4.0(compatible;MSIE6.0;WindowsNT5.1;SV1)

Request.ServerVariables("Https_Keysize")
安全套接字層連接關鍵字的位數,如128

Request.ServerVariables("Https_Secretkeysize")
伺服器驗證私人關鍵字的位數如1024

Request.ServerVariables("Https_Server_Issuer")
伺服器證書的發行者欄位

Request.ServerVariables("Https_Server_Subject")
伺服器證書的主題欄位

Request.ServerVariables("Auth_Password")
當使用基本驗證模式時,客戶在密碼對話框中輸入的密碼

Request.ServerVariables("Auth_Type")
是用戶訪問受保護的腳本時,伺服器用於檢驗用戶的驗證方法

Request.ServerVariables("Auth_User")
代證的用戶名

Request.ServerVariables("Cert_Cookie")
唯一的客戶證書ID號

Request.ServerVariables("Cert_Flag")
客戶證書標志,如有客戶端證書,則bit0為0如果客戶端證書驗證無效,bit1被設置為1

Request.ServerVariables("Cert_Issuer")
用戶證書中的發行者欄位

Request.ServerVariables("Cert_Keysize")
安全套接字層連接關鍵字的位數,如128

Request.ServerVariables("Cert_Secretkeysize")
伺服器驗證私人關鍵字的位數如1024

Request.ServerVariables("Cert_Serialnumber")
客戶證書的序列號欄位

Request.ServerVariables("Cert_Server_Issuer")
伺服器證書的發行者欄位

Request.ServerVariables("Cert_Server_Subject")
伺服器證書的主題欄位

Request.ServerVariables("Cert_Subject")
客戶端證書的主題欄位

Request.ServerVariables("Content_Type")
客戶發送的form內容或HTTPPUT的數據類型

D. ASP獲取地址欄地址和目錄

Function GetUrl()
Dim ScriptAddress,Servername,qs
ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME"))
Servername = CStr(Request.ServerVariables("Server_Name"))
qs=Request.QueryString
if qs<>"" then
GetUrl ="http://"& Servername & ScriptAddress &"?"&qs
else
GetUrl ="http://"& Servername & ScriptAddress
end if
End Function

url=geturl()

url=left(url,InstrRev(url,"/"))
response.Write(url)

閱讀全文

與asp獲取url文件名相關的資料

熱點內容
隱藏網路為什麼別人可以連我不行 瀏覽:355
超級終端發送文件超時 瀏覽:24
文件多少m有什麼意思 瀏覽:63
microsoftword2010 瀏覽:773
國務院通信大數據行程卡在哪裡 瀏覽:581
列印機和電腦數據線連好怎麼操作 瀏覽:877
iphone打開html文件 瀏覽:63
java操作excel之poi 瀏覽:700
java集合同步 瀏覽:861
軟工大數據軟考考什麼 瀏覽:190
受控體系文件的封面有什麼內容 瀏覽:778
夢幻錦衣是哪個文件夾 瀏覽:811
raid模式不能黑蘋果 瀏覽:859
如何優化網站推廣方案 瀏覽:40
編程怎麼入門去極客時間 瀏覽:504
查看oracle資料庫字元集編碼 瀏覽:658
pscc恢復文件 瀏覽:245
釘釘怎麼上網路直播課 瀏覽:595
怎麼用手機qq掃描文件在哪裡 瀏覽:17
微信瓶子怎麼提示用完了 瀏覽:288

友情鏈接