c# Winforms WebBrowser - Clear all cookies
So the example code for it will be:
static void Main()
{
SuppressWininetBehavior(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
} [System.Runtime.InteropServices.DllImport("wininet.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)]
public static extern bool InternetSetOption(int hInternet, int dwOption, IntPtr lpBuffer, int dwBufferLength); private static unsafe void SuppressWininetBehavior()
{
/* SOURCE: http://msdn.microsoft.com/en-us/library/windows/desktop/aa385328%28v=vs.85%29.aspx
* INTERNET_OPTION_SUPPRESS_BEHAVIOR (81):
* A general purpose option that is used to suppress behaviors on a process-wide basis.
* The lpBuffer parameter of the function must be a pointer to a DWORD containing the specific behavior to suppress.
* This option cannot be queried with InternetQueryOption.
*
* INTERNET_SUPPRESS_COOKIE_PERSIST (3):
* Suppresses the persistence of cookies, even if the server has specified them as persistent.
* Version: Requires Internet Explorer 8.0 or later.
*/ int option = (int)3/* INTERNET_SUPPRESS_COOKIE_PERSIST*/;
int* optionPtr = &option; bool success = InternetSetOption(0, 81/*INTERNET_OPTION_SUPPRESS_BEHAVIOR*/, new IntPtr(optionPtr), sizeof(int));
if (!success)
{
MessageBox.Show("Something went wrong !>?");
}
}
This code is deleting the COOKIES per PROCESS on startup ONLY.
[tested on WIN-7 and working great]
c# Winforms WebBrowser - Clear all cookies的更多相关文章
- [Cookie] Clear Cookie
import com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport def myCookies = testRunner.testCa ...
- C# 清除cookies
不同的浏览器会把cookie文件保存在不同的地方 以下是C# WebBrowser控件cookies的存放路径 C:\Users\{你的帐号名}\AppData\Local\Microsoft\Win ...
- Chrome 开发工具之Network
经常会听到比如"为什么我的js代码没执行啊?","我明明发送了请求,为什么反应?","我这个网站怎么加载的这么慢?"这类的问题,那么问题既然 ...
- sqlHelper做增删改查,SQL注入处理,存储值,cookie,session
一.存储值 eg:登录一个页面,在进入这个页面之前你怎么知道它登没登录呢?[在登录成功之后我们把状态保存起来] 存储值得方式有两种,一种是cookie,一种是session 1.1区别: 代码: if ...
- Fiddler2 主菜单
Fiddler2 主菜单 六个主菜单分别是: 文件(File) Capture Traffic ——启用捕获功能,快捷键 F12 此功能的开启/关闭状态,程序安装后默认是开启的.可以在 Fiddler ...
- Jquery Ajax处理,服务端三种页面aspx,ashx,asmx的比较
常规的Jquery Ajax 验证登录,主要有3种服务端页面相应 ,也就是 aspx,ashx,asmx即webserivice . 下面分别用3种方式来(aspx,ashx,asmx)做服务端来处理 ...
- ASIHTTPREQUEST 文档
http://blog.csdn.net/ysysbaobei/article/details/17026577 Please note that I am no longer working on ...
- 详解Google Chrome浏览器(操作篇)(下)
开篇概述 由于最近忙于公司产品的架构与研发,已经三个多月没有写博客了,收到有些朋友的来信,问为什么不及时更新博客内容呢,他们说他们正期待着某些内容.对此,非常抱歉,那么我在此也给各位朋友一些承诺,从即 ...
- Chrome DevTools 调研笔记
1 说明 此篇文章针对Chrome DevTools常用功能进行调研分析.描述了每个功能点能实现的功能.应用场景和详细操作. 2 Elements 2.1 功能 检查和实时更新页面的HTML与C ...
随机推荐
- sql cast()和convert()
19.CAST()函数和CONVERT()函数 CAST()函数可以将某种数据类型的表达式转化为另一种数据类型 CONVERT()函数也可以将制定的数据类型转换为另一种数据类型 19.1 CAST() ...
- eclipse+adt+sdk开发环境搭配
1.开发环境配置 http://www.mamicode.com/info-detail-516839.html
- SSH命令行上传/下载文件
上传:scp /path/file(这部分为本地的路径) user(远端目标用户名)@host(远端目标IP):/pathorfile(文件存储路径) 下载:scp user(远端用户名)@host( ...
- 【转】 SIFT算法详解
尺度不变特征变换匹配算法详解Scale Invariant Feature Transform(SIFT)Just For Fun zdd zddmail@gmail.com 对于初学者,从Davi ...
- 【C#】获取当前系统桌面、我的照片、我的文档等路径
获取当前系统桌面.我的照片.我的文档等路径 using System; using System.Collections.Generic; using System.ComponentModel; ...
- 024-ActionResult解说
ActionResult是一个抽象类,是Action运行后的回传类型,但是当Action回传ActionResult的时候,其实并不包含这个ActionResult的运行结果,而是包含运行这个Acti ...
- 20145236 《Java程序设计》第4周学习总结
20145236 <Java程序设计>第4周学习总结 教材学习内容总结 第六章 继承与多态 一.继承 •继承是java面向对象编程技术的一块基石,因为它允许创建分等级层次的类.继承可以理解 ...
- springMvc配置编码过滤器
在web.xml中配置 <!-- 编码过滤器 --> <filter> <filter-name>characterEncodingFilter</filte ...
- MASS批量维护
T-CODE: MASS 批量更改MASS_CHARVAL 特征的批量维护MASS_EINE 信息记录的成批维护MASS_EKKO 采购订单的成批维护MASS_MARC 后勤/配送的成批维护MASS_ ...
- netty4 连通步骤
转载:http://xw-z1985.iteye.com/blog/1973205 服务端依次发生的步骤 建立服务端监听套接字ServerSocketChannel,以及对应的管道pipeline: ...