2

我想检查回收站中的文件,就好像它是一个普通目录一样,特别是获取那里的文件列表以及每个文件到达回收站的日期。

4

1 回答 1

5

这段代码可以帮助你

'Access the recycle bin folder  
    Dim SH As New Shell32.Shell  
    Dim RecycleBin As Shell32.Folder = SH.NameSpace(Shell32.ShellSpecialFolderConstants.ssfBITBUCKET)  

    Dim SB As New StringBuilder  
    'Loop through the Recycle Bin and get each Items Name  
    For Each Item As Shell32.FolderItem In RecycleBin.Items  
        SB.AppendLine(Item.Name)  
    Next Item  

    'Display the list of filenames in a label  
    Label1.Text = SB.ToString  
于 2012-11-03T10:39:37.827 回答