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);
                }
            }
        }
原文地址:https://www.cnblogs.com/Googler/p/3741112.html