Deletes a file or directory to the recycle bin using the Shell. Optional confirmation dialog.

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,
	bool showConfirmation
)
Visual Basic
<ExtensionAttribute> 
Public Shared Sub DeleteToRecycleBin ( 
	fileInfo As FileSystemInfo,
	showConfirmation As Boolean
)
Visual C++
public:
[ExtensionAttribute]
static void DeleteToRecycleBin(
	FileSystemInfo^ fileInfo, 
	bool showConfirmation
)
F#
static member DeleteToRecycleBin : 
        fileInfo : FileSystemInfo * 
        showConfirmation : bool -> unit 

Parameters

fileInfo
Type: System.IO..::..FileSystemInfo
The FileInfo object that represents the file to delete.
showConfirmation
Type: System..::..Boolean
Whether to show the stock confirmation dialog for this action.

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