[DllImport("shlwapi.dll", CharSet=CharSet.Auto)]
static extern bool PathAppend([In, Out] StringBuilder pszPath, string pszMore);
''' <summary>
''' Appends one path to the end of another.
''' </summary>
''' <param name="pszPath">A pointer to a null-terminated string to which the path specified in pszMore is appended.</param>
''' <param name="pszMore">A pointer to a null-terminated string of maximum length MAX_PATH that contains the path to be appended.</param>
''' <returns>Returns TRUE if successful, or FALSE otherwise.</returns>
''' <remarks>
''' This function automatically inserts a backslash between the two strings,
''' if one is not already present.
''' The path supplied in pszPath cannot begin with "..\\" or ".\\" to produce a relative path
''' string. If present, those periods are stripped from the output string.
''' For example, appending "path3" to "..\\path1\\path2" results in an output of "\path1\path2\path3" rather than "..\path1\path2\path3".
''' </remarks>
<DllImport("shlwapi.dll", EntryPoint:="PathAppendW", SetLastError:=True, CharSet:=CharSet.Unicode)> _
Public Function PathAppend(<MarshalAs(UnmanagedType.LPTStr)>pszPath As System.Text.StringBuilder, _
<MarshalAs(UnmanagedType.LPTStr)>pszMore As String) As <MarshalAs(UnmanagedType.Bool)>Boolean
End Function
Public Declare Function PathAppend Lib "shlwapi" Alias "PathAppendA" _
(ByVal pszPath As String, _
ByVal pszMore As String) As Long
This is similar, but not identical, to PathCombine and Path.Combine. For example, appending "C:\foo" with "\bar" yields "C:\foo\bar" rather than "C:\bar" or "\bar", respectively.
Please add some!
Please add some!