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); } } }