Deletes a file.
[Visual Basic] Overloads Overrides Public Sub Delete() [C#] public override void Delete(); [C++] public: override void Delete(); [JScript] public override function Delete();
Exception Type | Condition |
---|---|
ArgumentNullException | path is a null reference (in Visual Basic Nothing). |
IOException | The target file is open or memory mapped on a machine running Windows NT. |
SecurityException | The caller does not have the required permission. |
On a machine running Windows NT, Delete will fail for a file that is open for normal I/O or a file that is memory mapped. On Win95, the file will be deleted even if the file is in use.
NGWS Runtime Security:
FileIOPermissionAccess | Write permission to the path. |
File Class | File Members | System.IO Namespace | File.Delete Overload List