Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在System.Net.CookieContainer
System.Net.CookieContainer
如果我想删除一个域名下的所有cookies,怎么办?
你可以做这样的事情。
CookieContainer c = new CookieContainer(); var cookies = c.GetCookies(new Uri("http://www.google.com")); foreach (Cookie co in cookies) { co.Expires = DateTime.Now.Subtract(TimeSpan.FromDays(1)); }
这将使您指定的域的所有 cookie 过期。