111,120
社区成员
发帖
与我相关
我的任务
分享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
using System.Runtime.InteropServices;
namespace WindowsApplication281
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Shell S = new Shell();
int CSIDL_INTERNET_CACHE = 0x20;
Folder F = S.NameSpace(CSIDL_INTERNET_CACHE);
foreach (FolderItem FI in F.Items())
{
MessageBox.Show(FI.Path);
foreach (FolderItemVerb FIV in FI.Verbs())
if (FIV.Name == "删除(&D)") // 删除cookie的时候会弹出是否删除对话框
{
FIV.DoIt();
break;
}
}
Marshal.FinalReleaseComObject(S);
}
}
}