如题:c# 遍历获取本地Cookies文件夹下所有文件信息。
如题:c# 遍历获取本地Cookies文件夹下所有文件信息。
如题:c# 遍历获取本地Cookies文件夹下所有文件信息。
FileStream fs = new FileStream(filePath, FileMode.Open,FileAccess.Read, FileShare.ReadWrite);
StreamReader sr = new StreamReader(fs, System.Text.Encoding.Default);
filePath换成index.dat文件路径即可读取
完整的贴上来
List listCookie = new List();
string[] strCookies = null;
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", false);
if (key != null)
{
string val = (string)key.GetValue("Cookies");
if (val != null)
{
strCookies = Directory.GetFiles(val);
if (strCookies != null)
{
foreach (string str in strCookies)
{
if (str.Contains("index.dat"))
{
listCookie.Add(str);
}
}
}
}
}