如何将文件移动到回收站 [英] How to Move files to the recycle bin
本文介绍了如何将文件移动到回收站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要移动一个文件在.net中到回收站2003
I need to Move a file to recycle bin in .net 2003
我添加microsft.visualbasic.runtime从refrence DLL中,但我不能能够得到文件系统.deletedirectory,所以要do..Can了任何一个可以帮助我?
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?
推荐答案
我发现这个,不知道它是否。作品,但它是值得一试。
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);
编辑:从Nifle明智的话:
只记得添加到Microsoft.VisualBasic程序参考.DLL
Wise words from Nifle: Just remember to add a reference to Microsoft.VisualBasic.dll
这篇关于如何将文件移动到回收站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文