導航:首頁 > 文件教程 > 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文件名相關的資料

熱點內容
專題學習網站源碼 瀏覽:163
jsphead什麼 瀏覽:88
gps串口數據怎麼發送 瀏覽:968
win10文件主頁共享查看 瀏覽:411
中國聯通有哪些app是免流的 瀏覽:176
邊做邊保存的文件找不到了 瀏覽:858
win10照片應用文件夾名稱 瀏覽:966
編程如何解決資金的原子性 瀏覽:638
如何製作廣角鏡頭矯正文件 瀏覽:513
在網頁開發中應該選用哪個資料庫 瀏覽:742
iphone5移動卡貼 瀏覽:990
電腦文件的格式 瀏覽:127
extjs的xtype 瀏覽:959
suse11iso文件要u盤安裝 瀏覽:153
如何將報表統計數據轉化為圖形 瀏覽:444
如何寄快遞材料文件 瀏覽:265
java構造方法private 瀏覽:475
手機文件找回恢復 瀏覽:516
word怎麼把u盤里的文件拔掉 瀏覽:976
港版蘋果用的插排 瀏覽:1000

友情鏈接