How to clear browser cookies in code behind ?
Reg:Cookies
Collapse
X
-
This should give you a start -, at present it just adds the cookies to a listbox but would be easy to amend to delete them
Code:private void GetCookies() { string path = Environment.GetFolderPath(Environment.SpecialFolder.Cookies); DirectoryInfo CookiesDirectory = new DirectoryInfo(path); foreach (FileInfo filex in CookiesDirectory.GetFiles()) if (filex.Name != "index.dat") { { listBox1.Items.Add(filex.Name); } } }
Comment