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.
In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path or "\\?\UNC\" for fileshares on server, respectively. e.g. "\\?\D:\very long path" or "\\?\UNC\server\share"
Tips & Tricks:
Please add some!
Sample Code:
String filePath = @"C:\Data\MyFile.txt";
bool deleted = DeleteFileW(filePath);
if (!deleted)
{
int lastError = Marshal.GetLastWin32Error();
Console.WriteLine("Failed to delete '{1}': error={0}", lastError, filePath);
}
Alternative Managed API:
System.IO.File:
public static void Delete(string path);
The DeleteFile API
5/25/2023 3:06:34 AM - -188.21.234.130
Please edit this page!
Do you have...
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).