Deletes the file or directory to the recycle bin using the Shell.

Namespace: System.Extensions.IO
Assembly: System.Extensions (in System.Extensions.dll) Version: 0.0.0.5 (0.0.0.5)

Syntax

C#
public static void DeleteToRecycleBin(
	this FileSystemInfo fileInfo
)
Visual Basic
<ExtensionAttribute> 
Public Shared Sub DeleteToRecycleBin ( 
	fileInfo As FileSystemInfo
)
Visual C++
public:
[ExtensionAttribute]
static void DeleteToRecycleBin(
	FileSystemInfo^ fileInfo
)
F#
static member DeleteToRecycleBin : 
        fileInfo : FileSystemInfo -> unit 

Parameters

fileInfo
Type: System.IO..::..FileSystemInfo
The FileInfo object that represents the file to delete.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type FileSystemInfo. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also