Click or drag to resize
FileInfoDelete Method
Permanently deletes a file.

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public override void Delete()
Exceptions
ExceptionCondition
IOExceptionThe target file is open or memory-mapped on a computer running Microsoft Windows NT.-or-There is an open handle on the file, and the operating system is Windows XP or earlier. This open handle can result from enumerating directories and files. For more information, see How to: Enumerate Directories and Files.
SecurityExceptionThe caller does not have the required permission.
UnauthorizedAccessExceptionThe path is a directory.
See Also