C # Clear cookies,
Different browsers store cookie files in different places
The following is the path for storing cookies in the C # WebBrowser control:
C: \ Users \ {your account name} \ AppData \ Local \ Microsoft \ Windows \ INetCookies
For information on the cookie file format, see the following code for clearing cookies:
Using System; using System. collections. generic; using System. linq; using System. text; using System. threading. tasks; using System. IO; namespace DelCookies {class Program {static void Main (string [] args) {DelCookies ("360.cn/"); Console. writeLine ("cookies have been deleted. "); Console. read ();} static void DelCookies (string domain) // domain is the domain of cookies, this method is to clear cookies through the domain Filter {// get the file path in the Directory string [] cookies = Directory. getFi Les (Environment. getFolderPath (Environment. specialFolder. cookies); foreach (string file in cookies) {try {StreamReader sr = new StreamReader (file); string txt = sr. readToEnd (); sr. close (); if (txt. indexOf (domain )! =-1) // determine whether to Delete the cookies File {file. Delete (File) ;}} catch (Exception ex ){}}}}}
Address: http://www.cnblogs.com/iamlucky/p/6010858.html