Ir al índice principal
el Guille, la Web del Visual Basic, C#, .NET y más...
  Lo+ - WinFX - .NET - ADO.NET - ASP.NET - Cómo... - Colabora - VB6 - HTML - Vista - Links - Foros  

Buscar en Google y en elGuille.info:
Google
 

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).

elGuille.Hosting, seguramente los mejores precios de alojamiento




 

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);

 





Contribuye con el Guille
Aporta tu granito de arena y ayuda a mantener el sitio del Guille...


Cosas que te pueden interesar



Mentor de
Solid Quality mentors
Most Valuable Professional
MVP de Visual Basic desde 1997



Orador internacional de Ineta
Orador de Ineta Latam

ir al índice del Guille

Valid XHTML 1.0 Transitional


Escribir un mensaje al Guille (mensaje EN elGuille.info)
Has entrado usando el host: www.mundoprogramacion.com
Puedes verlo también en: http://www.elguille.info/net/api/getshortpathname.aspx