@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The GetFullPathName API !!!!C# Signature: [DllImport("kernel32.dll")] static extern uint GetFullPathName(string lpFileName, uint nBufferLength, [Out] StringBuilder lpBuffer, out StringBuilder lpFilePart); !!!!VB.net Signature: <DllImport("kernel32.dll")> _ Shared Function GetFullPathName(ByVal lpFileName As String, ByVal nBufferLength As Int32, <Out()> ByVal lpBuffer As System.Text.StringBuilder, <Out()> ByVal lpFilePart As System.Text.StringBuilder) As Int32 !!!!User-Defined Types: None. !!!!Notes: None. !!!!Tips & Tricks: Please add some! !!!!Sample Code: C# Sample int bufsz = 1; // We'll grow this as necessary string sRel = @"c:\windows\System\..\system32\desktop.ini"; // Note relative path StringBuilder sbFull = new StringBuilder(bufsz); // Full resolved path will go here StringBuilder sbFile = new StringBuilder(bufsz); // Filename will go here uint u = GetFullPathName(sRel, (uint)bufsz, sbFull, out sbFile); // 1st call: Get necessary bufsz if (u > bufsz) // 'u' should be >1 { bufsz = (int)u + 10; // Required size plus a few sbFull = new StringBuilder(bufsz); // Re-create objects w/ proper size sbFile = new StringBuilder(bufsz); // " u = GetFullPathName(sRel, (uint)bufsz, sbFull, out sbFile); // Try again, this should succeed // 'sbFull' should now contain "c:\windows\system32\desktop.ini" // and 'sbFile' should contain "desktop.ini" } !!!!Alternative Managed API: System.IO.FileSystemInfo.FullName or System.IO.Path.GetFullPath. Documentation: GetFullPathName@msdn on MSDN
Edit kernel32.GetFullP...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.