remove cookies of webBrowser control in c# .net
string[] Cookies = System.IO.Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.Cookies));
int notDeleted = 0;
foreach (string CookieFile in Cookies)
{
try
{
System.IO.File.Delete(CookieFile);
}catch (Exception ex)
{
notDeleted++;
}
}
MessageBox.Show((Cookies.Length - notDeleted).ToString() + " Cookies Deleted, " + notDeleted.ToString() + " Cookies Not Deleted", "Cookies");