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

Deletes the file specified by the fully qualified path. An exception is not thrown if the specified file does not exist.

[Visual Basic]
Overloads Public Shared Sub Delete( _
   ByVal path As String _
)
[C#]
public static void Delete(
   string path
);
[C++]
public: static void Delete(
   String* path
);
[JScript]
public static function Delete(
   path : String
);

Parameters

path
The path of the file to be deleted.

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.
ArgumentException path is empty or contains only whitespaces.

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