Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than kernel32, prefix the name with the module name and a period.
// Get the minimum number of path separators in a valid string... will vary depending on whether it's a UNC path or not.
int minDirSepPos = 4; // \\?\c:\dir
if (normalizedPath.Contains("UNC"))
{
minDirSepPos = 6; // \\?\UNC\server\share\dir
}
// Get the minimum remaining string length once all required path components are accounted for.
int minLength = -1;
try
{
for (int i = 0; i < minDirSepPos; i++)
{
minLength = normalizedPath.IndexOfAny(dirSeps, ++minLength);
}
}
catch (ArgumentOutOfRangeException e)
{
throw new ArgumentException("Invalid path specified: " + path);
}
while (true)
{
// Remove the path
if (!NativeMethods.RemoveDirectory(normalizedPath))
{
throw LongPathCommon.GetExceptionFromLastWin32Error();
}
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).