c# winfrom获取 本地 Cookies文件夹下txt文件可以,并且能读取到里面的信息内容,但是获取index.dat文件提示访问不了之类的说法,是什么原因??求解C#Cookie
解决方案 »
- 初学C#,求教个问题
- 一个sql递归更新
- C# mousedown mousemove事件调试
- C#有没有函数能把带字母的字符串转换为数值
- 请教 C# 如何实现类似 Project 的甘特图.
- 高分求:如何将dataset中的数据导入到excel中.
- 我做的winform程序,打包后以便在别的机器上(框架已安装)使用,为什么只把exe、dll、cofing文件打包就能运行程序???
- 使用SqlCommand对象进行数据读取时,即使用datareader读取数据的问题
- c#真是好!欢迎大家来讨论c#!
- 如何在类中包装一个.net组件的事件?
- .net 读取本地上网记录
- C# 在中文系统和英文系统, 为什么窗体显示大小不一样?
StreamReader sr = new StreamReader(fs, System.Text.Encoding.Default);
filePath换成index.dat文件路径即可读取
完整的贴上来
List<string> listCookie = new List<string>();
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);
}
}
}
}
}