Attribut ShortPath ASP
Définition et utilisation
L'attribut ShortPath est utilisé pour retourner le chemin court du fichier ou du dossier spécifié (conventions de nommage des fichiers 8.3).
Syntaxe :
FileObject.ShortPath FolderObject.ShortPath
Exemple pour l'objet File
<% dim fs,f set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.GetFile("c:\asp_test_web\hitcounterfile.txt") Response.Write("Chemin: " & f.Path) Response.Write("<br />ShortPath: " & f.ShortPath) set f=nothing set fs=nothing %>
Sortie :
Chemin: C:\asp_test_web\hitcounterfile.txt ShortPath: C:\ASP_TE~1\HITCOU~1.TXT
Exemple pour l'objet Folder
<% dim fs,fo set fs=Server.CreateObject("Scripting.FileSystemObject") set fo=fs.GetFolder("c:\asp_test_web") Response.Write("Chemin: " & fo.Path) Response.Write("<br />ShortPath: " & fo.ShortPath) set fo=nothing set fs=nothing %>
Sortie :
Path: C:\asp_test_web ShortPath: C:\ASP_TE~1