RecycleOption 枚举


指定文件是应永久删除还是放入“回收站”中。Specifies whether a file should be deleted permanently or placed in the Recycle Bin.

public enum class RecycleOption
public enum RecycleOption
type RecycleOption = 
Public Enum RecycleOption


DeletePermanently 2

永久删除文件或目录。Delete the file or directory permanently. 默认。Default.

SendToRecycleBin 3

将文件或目录发送至“回收站”。Send the file or directory to the Recycle Bin.


此枚举与DeleteDirectoryDeleteFile方法一起使用。This enumeration is used with the DeleteDirectory and DeleteFile methods.

为了防止用户意外删除重要文件,回收站会收集删除的文件, 并提供还原这些文件的方法。To protect users against accidental deletion of important files, the Recycle Bin collects deleted files and provides a method for restoring those files. 必须从 "回收站" 中显式删除这些文件才能使删除永久删除。You must explicitly delete the files from the Recycle Bin to make the deletion permanent. 回收站中删除文件之前, 这些文件占用的磁盘空间不适用于其他用途。Until the files are deleted from the Recycle Bin, the disk space occupied by those files is unavailable for other uses.

有时, 绕过回收站是有好处的, 尤其是删除大量文件 (或较小数量的非常大的文件), 但又想要回收磁盘空间。Sometimes it is beneficial to bypass the Recycle Bin, especially if you are deleting a large number of files (or a smaller number of very large files) that you are sure are no longer needed, and you want to reclaim the disk space.