NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

File.Delete ()

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();

Exceptions

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.

Remarks

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.

Requirements

NGWS Runtime Security:

FileIOPermissionAccess Write permission to the path.

See Also

File Class | File Members | System.IO Namespace | File.Delete Overload List