09/10/2018, 18:03
đường dẫn, FileSystemObject
làm cách nào để lấy được đường dẫn của thư mục hiện tại
vd file của tôi đang ở, http://domain.com/folder/file.htm
làm sao để lấy được cả dòng http://domain.com/folder
cám ơn sự giúp đỡ.
vd file của tôi đang ở, http://domain.com/folder/file.htm
làm sao để lấy được cả dòng http://domain.com/folder
cám ơn sự giúp đỡ.
Bài liên quan





Server.MapPath("../") lấy thư mục cha của trang trang bạn
Request.ServerVariables("APPL_PHYSICAL_PATH") lấy được thư mục gốc của trang web.
Function GetVirtualScriptPath folder = Request.ServerVariables("SCRIPT_NAME") folder = Left(folder, InStrRev(folder,"/") - 1) GetVirtualScriptPath = "http://" & Request.ServerVariables("SERVER_NAME") & folder End Function<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <html> <head> <title>Get Virtual Folder</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <% Function GetVirtualScriptPath folder = Request.ServerVariables("SCRIPT_NAME") folder = Left(folder, InStrRev(folder,"/") - 1) GetVirtualScriptPath = "http://" & Request.ServerVariables("SERVER_NAME") & folder End Function Response.Write(GetVirtualScriptPath) %> </body> </html>