recycle-bin

How to Move files to the recycle bin

为君一笑 提交于 2019-12-08 15:19:12
问题 I need to Move a file to recycle bin in .net 2003 I added microsft.visualbasic.runtime dll from refrence, but I could not able to get filesystem.deletedirectory, So what to do..Can any one help me? 回答1: I found this, don't know if it works, but it's worth a shot. using Microsoft.VisualBasic; string path = @"c:\myfile.txt"; FileIO.FileSystem.DeleteDirectory(path, FileIO.UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin); EDIT: Wise words from Nifle: Just remember to add a reference to

get the date when the file was sent to recycle bin

孤街浪徒 提交于 2019-12-07 09:22:56
问题 Is there any call which will get the date when the file was sent to recycle bin. Items object in Shell32 gives the lastmodified date but not when it is sent to recycle bin. I want to be able to restore files deleted on a particular date. 回答1: OK - as usual it is very simple when you know how. I was thinking this would be a property of the file - but it is not - it is a property of the recycle bin. So once a link to the recycle bin has been got: var Shl = new Shell(); Folder Recycler = Shl

get the date when the file was sent to recycle bin

我们两清 提交于 2019-12-05 18:44:07
Is there any call which will get the date when the file was sent to recycle bin. Items object in Shell32 gives the lastmodified date but not when it is sent to recycle bin. I want to be able to restore files deleted on a particular date. OK - as usual it is very simple when you know how. I was thinking this would be a property of the file - but it is not - it is a property of the recycle bin. So once a link to the recycle bin has been got: var Shl = new Shell(); Folder Recycler = Shl.NameSpace(10); FI = Recycler.Items().Item(0); string FileName = Recycler.GetDetailsOf(FI, 0); string FilePath =

How can I get path to recycle bin?

你。 提交于 2019-12-04 01:49:12
问题 I would like to get the path to recycle bin. I searched online and found people use shell32 and get a list of files in recycle bin. However, I only want to get the path of recycle bin since my purpose is to exclude monitor recycle bin from my filewatcher when setting IncludeSubdirectories to true. The code using shell32 to get a list of files shown in the following, but I don't to how to get the path to recycle bin. Shell Shl = new Shell(); Folder Recycler = Shl.NameSpace(10); for (int i = 0;

How can I move file into Recycle Bin / trash on different platforms using PyQt4?

随声附和 提交于 2019-12-03 04:46:19
问题 I would like to add the next feature to my cross-platform PyQt4 application: when user selects some file and select "remove" action on it that file will be moved to Recycle Bin folder instead of being permantly removed. I think I can find Windows-specific solution using Win32 API or something similar, but I'd like to know does similar operation could be executed on Ubuntu/Linux and MaxOSX as well via PyQt4 methods. 回答1: It's a good thing you're using Python, I created a library to do just

How to move a symlink to the trash?

与世无争的帅哥 提交于 2019-12-01 18:23:45
I don't see any options for the FSPathMoveObjectToTrashSync() function for not following links. Here is what I have tried Create a link and a file [ 21:32:41 /tmp ] $ touch my_file [ 21:32:45 /tmp ] $ ln -s my_file my_link [ 21:32:52 /tmp ] $ la total 8 drwxrwxrwt 12 root wheel 408 17 Maj 21:32 . drwxr-xr-x@ 6 root wheel 204 9 Sep 2009 .. -rw-r--r-- 1 neoneye wheel 0 17 Maj 21:32 my_file lrwxr-xr-x 1 neoneye wheel 7 17 Maj 21:32 my_link -> my_file Move the link to the trash OSStatus status = FSPathMoveObjectToTrashSync( "/tmp/my_link", NULL, kFSFileOperationDefaultOptions ); NSLog(@"status: %i

Properly move an object to the Trash

一个人想着一个人 提交于 2019-12-01 17:12:30
It looks like on Cocoa there are many ways to move file/folder-directory to Trash: [[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation] [[NSWorkspace sharedWorkspace] recycleURLs:] [NSFileManager trashItemAtURL:] [NSFileManager removeItemAtPath:] [NSFileManager removeItemAtURL:] It would be nice to understand what the difference is by either reading an explanation here or a link to the official Apple docs. Also if someone knows a universal way of moving a file/non-empty directory to Trash, it would be nice to know. [[[NSWorkspace sharedWorkspace]

Is there a way to retrieve the meta for a deleted Item (File/Folder) for Office365 OneDrive through REST API?

百般思念 提交于 2019-12-01 08:14:06
I'm looking for a way to retrieve the meta for a deleted item(file/folder). I'm able to get change logs indicating that a certain action has been performed on an Item, and I've been able to retrieve the Item itself as well if it hasn't been deleted. The problem arises when this item gets deleted. In that case, I only know the ID of the Item and when I query the Item itself, I get a 404 (saying object has been deleted). Recently, I read the following posts http://office.microsoft.com/en-001/windows-sharepoint-services-help/view-restore-or-delete-items-in-the-recycle-bin-of-a-sharepoint-site

list filenames in the recyclebin with c# without using any external files

风格不统一 提交于 2019-11-30 23:08:53
I would like to have a function which retrieves me the filenames in the recycle bin (on win 7) with usage of c# code. The framework seems nothing to contain to achieve this. Directory.Getfiles() wouldn't work on it, would it? I found myself a code with using "windows shell32 automation" but this requires to supply interop.shell32.dll which must be redistributed with my application. Since my application should work standalone (as long Net Framework 2 exists on users computer), this solution isn't ideal. This solution seems also to be unreliable to me, since it uses COM Automation and some

list filenames in the recyclebin with c# without using any external files

末鹿安然 提交于 2019-11-30 18:47:07
问题 I would like to have a function which retrieves me the filenames in the recycle bin (on win 7) with usage of c# code. The framework seems nothing to contain to achieve this. Directory.Getfiles() wouldn't work on it, would it? I found myself a code with using "windows shell32 automation" but this requires to supply interop.shell32.dll which must be redistributed with my application. Since my application should work standalone (as long Net Framework 2 exists on users computer), this solution