@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: Removes the trailing file name and backslash from a path, if it has them. !!!!C# Signature: [DllImport("shlwapi.dll", CharSet=CharSet.Auto)] static extern bool PathRemoveFileSpec([In,Out] StringBuilder pszPath); !!!!VB Signature: Declare Function PathRemoveFileSpec Lib "shlwapi.dll" (TODO) As TODO !!!!User-Defined Types: None. !!!!Notes: None. !!!!Tips & Tricks: Please add some! !!!!Sample Code: StringBuilder str = new StringBuilder(@"C:\TEST\sample.txt"); bool bRet = PathRemoveFileSpec(str); // Result: bRet == true && str.ToString() == @"C:\TEST" !!!!Alternative Managed API: Do you know one? Please contribute it! Documentation: MSDN http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/shlwapi/path/pathremovefilespec.asp
Edit shlwapi.PathRemov...
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.