Méthode GetAbsolutePathName ASP

Définition et utilisation

La méthode GetAbsolutePathName retourne le chemin complet à partir du disque de racine pour un chemin spécifié.

Syntaxe :

FileSystemObject.GetAbsolutePathName(path)
Paramètre Description
path Obligatoire. Doit être modifié en chemin complet.

Exemple

Exemple 1

<%
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("c:")
response.write(path)
%>

Sortie :

c:\temp\test

Exemple 2

<%
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("mydoc.txt")
response.write(path)
%>

Sortie :

c:\temp\test\mydoc.txt

Exemple 3

<%
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("private\mydoc.txt")
response.write(path)
%>

Sortie :

c:\temp\test\private\mydoc.txt