Googler

两情相悦,又岂在朝朝暮暮。

C# Delete Url Cookie

        public static void DeleteCookieFile(Uri url)
        {
            string path = Environment.GetFolderPath(Environment.SpecialFolder.Cookies);
            foreach (string filePath in Directory.EnumerateFiles(path))
            {
                bool find = false;
                foreach (string line in File.ReadLines(filePath))
                {
                    if (line.LastIndexOf(url.Host) != -1)
                    {
                        App.LogInfo("dc {0}", filePath);
                        find = true;
                        break;
                    }
                }
                if (find)
                {
                    File.Delete(filePath);
                }
            }
        }

 

posted on 2014-05-21 13:56  RockyLOMO  阅读(292)  评论(0)    收藏  举报

导航

Apple/苹果笔记本 Mac Air MC968CH/A 行货在保 I5 11寸 超级本