110,533
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Shell32; // 添加引用->COM->Microsoft Shell Controls And Automation
namespace WindowsApplication229
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Shell S = new Shell();
int CSIDL_BITBUCKET = 0xA;
Folder F = S.NameSpace(CSIDL_BITBUCKET);
foreach (FolderItem FI in F.Items())
{
String PathName = F.GetDetailsOf(FI, 1) + "\\" + F.GetDetailsOf(FI, 0);
if (PathName == @"C:\DOCUME~1\ADMINI~1.251\LOCALS~1\Temp\vs32.tmp")
{
foreach (FolderItemVerb FIV in FI.Verbs())
if (FIV.Name == "删除(&D)")
{
FIV.DoIt(); // 会弹出是否真的彻底删除文件的对话框
break;
}
break;
}
}
}
}
}