webBrowser 清空cookie
来源:互联网 发布:东华大学网络教育平台 编辑:程序博客网 时间:2024/05/16 01:37
[DllImport("wininet.dll", SetLastError = true)]
private static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int lpdwBufferLength);
//清空session
public void ResetSession()
{
//Session的选项ID为42
InternetSetOption(IntPtr.Zero, 42, IntPtr.Zero, 0);
}
//清空cookie
public void ResetCookie()
{
ResetSession();
if (webBrowser1.Document != null)
{
webBrowser1.Document.Cookie.Remove(0, webBrowser1.Document.Cookie.Length);
}
string[] theCookies = System.IO.Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.Cookies));
foreach (string currentFile in theCookies)
{
try
{
System.IO.File.Delete(currentFile);
}
catch (Exception ex)
{
}
}
}
private static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int lpdwBufferLength);
//清空session
public void ResetSession()
{
//Session的选项ID为42
InternetSetOption(IntPtr.Zero, 42, IntPtr.Zero, 0);
}
//清空cookie
public void ResetCookie()
{
ResetSession();
if (webBrowser1.Document != null)
{
webBrowser1.Document.Cookie.Remove(0, webBrowser1.Document.Cookie.Length);
}
string[] theCookies = System.IO.Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.Cookies));
foreach (string currentFile in theCookies)
{
try
{
System.IO.File.Delete(currentFile);
}
catch (Exception ex)
{
}
}
}
0 0
- webBrowser 清空cookie
- jsp清空cookie
- 清空cookie
- C#有效清空cookie
- c# cookie 如何清空
- asp.net 清空Cookie
- 退出,清空cookie
- asp.net清空Cookie注销
- 清空 Post过程中的 cookie
- webView清空缓存和所有Cookie
- 删除所有cookie或者清空所有cookie值
- js cookie设置cookie, 删除cookie, 获取cookie,清空cookie
- C# GeckoFX内核浏览器清空Cookie的方法
- iOS JS交互之cookie设置与清空
- javascript 关闭浏览器怎么清空所有的cookie
- 使用C#清空Edge浏览器的Cookie
- 清空
- cookie:记住用户最后一次的访问时间,并清空指定cookie
- 安装Tomcat 7.0
- INI文件操作
- 基本排序系列之希尔排序
- log_file_name_convert的更改与ORA-01516和ORA-01275
- Apache Kafka:下一代分布式消息系统
- webBrowser 清空cookie
- libstreaming 源码分析一之RTSP连接
- iphone5、xcode4.5
- redis 下key的过期时间详解:expire
- oracle 游标详解
- Q编程6:Qt日志处理方法(qInstallMsgHandler函数)简单实用
- mysql数据库恢复(*frm)文件
- libstreaming源码分析二之MediaRecorder编码
- 苹果公司Swift语言将掀起革命