Metodo ASP GetFileName


❮ Riferimento completo dell'oggetto FileSystemObject

Il metodo GetFileName restituisce una stringa che contiene il nome del file o della cartella per l'ultimo componente in un percorso specificato.

Sintassi

FileSystemObject.GetFileName(path)

Parameter Description
path Required. The path to a specific file or folder

Esempi

Ottieni un nome file:

<%
dim fs,p
set fs=Server.CreateObject("Scripting.FileSystemObject")
p=fs.getfilename("c:\test\test.htm")
response.write(p)
set fs=nothing
%>

Output:

test.htm

Ottieni un nome cartella:

<%
dim fs,p
set fs=Server.CreateObject("Scripting.FileSystemObject")
p=fs.getfilename("c:\test\")
response.write(p)
set fs=nothing
%>

Output:

test

❮ Riferimento completo dell'oggetto FileSystemObject