Shared Function GetShortPathName_CreateDestroy(ByVal Path As String) As String Dim fCreate As Boolean = Not System.IO.File.Exists(Path) If fCreate Then System.IO.File.Create(Path).Dispose() Dim shortPath As String = GetShortPathName(Path) If fCreate Then System.IO.File.Delete(Path) Return shortPath End Function Shared Function GetShortPathName(ByVal Path As String) As String Dim shortPath As New System.Text.StringBuilder(255) GetShortPathName(Path, shortPath, shortPath.Capacity) Return shortPath.ToString() End Function <System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError:=True, _ CharSet:=System.Runtime.InteropServices.CharSet.Auto)> _ Private Shared Function GetShortPathName(ByVal Path As String, _ ByVal ShortPath As System.Text.StringBuilder, _ ByVal ShortPathLength As Integer) As Integer End Function
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.