el Guille, la Web del Visual Basic, C#, .NET y más...

GetShortPathName

 
Publicado el 30/Nov/2007
Actualizado el 30/Nov/2007
Autor: Guillermo 'guille' Som

GetShortPathName. Esta función la podemos usar para convertir un nombre largo en uno corto (tipo MS-DOS 8.3).



 

GetShortPathName

Esta función la podemos usar para convertir   un nombre largo en uno corto (tipo MS-DOS 8.3).

Ejemplos para VB6 y Visual Basic .NET y C#

 

Declaración en el API de Windows:

DWORD GetShortPathName(
  LPCTSTR lpszLongPath,  // pointer to a null-terminated path string
  LPTSTR lpszShortPath,  // pointer to a buffer to receive the 
                         // null-terminated short form of the path
  DWORD cchBuffer        // specifies the size of the buffer pointed 
                         // to by lpszShortPath
);

 

Declaración para VB6:

Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" _
        (ByVal lpszLongPath As String, _
        ByVal lpszShortPath As String, _
        ByVal cchBuffer As Long) As Long

 

Declaración   para VB .NET:

<System.Runtime.InteropServices.DllImport("kernel32.dll")> _
Private Shared Function GetShortPathName( _
        ByVal lpszLongPath As String, _
        ByVal lpszShortPath As System.Text.StringBuilder, _
        ByVal cchBuffer As Integer) As Integer
End Function

 

Declaración   para C#:

[System.Runtime.InteropServices.DllImport("kernel32.dll")] 
private extern static int GetShortPathName( 
        string lpszLongPath, 
        System.Text.StringBuilder lpszShortPath, 
        int cchBuffer);

 



 


Haz tu donativo a este sitio con PayPal
 

Busca en este sitio con Google
 
Google

La fecha/hora en el servidor es: 28/03/2024 20:31:25

La fecha actual GMT (UTC) es: 

©Guillermo 'guille' Som, 1996-2024