Interface IRecycleBin
- Namespace
- WindowsRecylceBin
- Assembly
- WindowsRecylceBin.dll
Provides access to the Windows recycle bin and allows to restore deleted files. To create an instance of this interface, use the static methods RecycleBin.ForCurrentUser() or RecycleBin.For(SecurityIdentifier sid).
public interface IRecycleBin
Methods
DeletePernamently(RecycleBinEntry)
Deletes the specified recycle bin entry pernamently.
void DeletePernamently(RecycleBinEntry entry)
Parameters
entry
RecycleBinEntryThe entry to delete.
Empty()
Empties the recycle bin. This will delete all entries pernamently.
void Empty()
EnumerateEntries()
Enumerates all entries in the recycle bin.
IEnumerable<RecycleBinEntry> EnumerateEntries()
Returns
GetEntries()
Gets all entries in the recycle bin.
List<RecycleBinEntry> GetEntries()
Returns
Restore(string)
Restores the specified file or directory. If more than one matching entry is found, the entry with the most recent deletion time is restored.
void Restore(string originalFilePath)
Parameters
originalFilePath
stringThe orginal path of the file or directory to restore.
Exceptions
- IOException
Thrown when the recycle bin contains no matching entry.
Restore(RecycleBinEntry)
Restores the specified recycle bin entry.
void Restore(RecycleBinEntry entry)
Parameters
entry
RecycleBinEntryThe entry to restore.