将文件 删除 到回收站 用怎样的代码?
如题 问题点数:20、回复次数:4Top
1 楼net_lover(【孟子E章】)回复于 2004-09-02 19:46:11 得分 20
Unfortunately, the Environment.SpecialFolder enumeration does not include values for all of the special folders supported by the Windows API and accessible by the SHGetFolderPath function. For example, you can't obtain the 回收站 directory location from Environment.GetFolderPath. To obtain locations that aren't identified by Environment.SpecialFolder, you have to use P/Invoke to call SHGetFolderPath or SHGetFolderLocation Windows API functions. Even with those restrictions, Environment.GetFolderPath is quite useful. You should use it to obtain special folder locations rather than assuming a particular path.
You can obtain the path to the system directory, by the way, through the Environment.SystemDirectory property, or by calling Environment.GetFolderPath and passing Environment.SpecialFolder.System.
Another important directory is the current directory: the directory in which the application is executing. The Environment.CurrentDirectory property will report the current directory, and also will allow you to change the application's current location.
Top
2 楼net_lover(【孟子E章】)回复于 2004-09-02 19:52:43 得分 0
vb的例子
http://www.developerfusion.com/show/179/Top
3 楼hxhbluestar(贺星河)回复于 2004-09-02 22:12:17 得分 0
学习!Top
4 楼csq0516(阿松)回复于 2004-09-03 02:37:21 得分 0
upTop




