GetLongPathName (kernel32)
Last changed: -137.48.131.236

.
Summary
Converts the specified path to its long form.

C# Signature:

[DllImport("kernel32.dll", SetLastError=true, CharSet=CharSet.Auto)]
static extern uint GetLongPathName(
    string lpszShortPath,
    [Out] StringBuilder lpszLongPath,
    uint cchBuffer);

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

/// <summary>
/// The ToShortPathNameToLongPathName function retrieves the long path form of a specified short input path
/// </summary>
/// <param name="shortName">The short name path</param>
/// <returns>A long name path string</returns>
public static string ToLongPathName(string shortName)
{
    StringBuilder longNameBuffer = new StringBuilder(256);
    uint bufferSize = (uint)longNameBuffer.Capacity;

    GetLongPathName(shortName, longNameBuffer, bufferSize);

    return longNameBuffer.ToString();
}

Alternative Managed API:

Do you know one? Please contribute it!

Documentation