日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

.NET WebBrowser不与IE或其他进程共享cookie(WebBrowser独立cookie方法)

發(fā)布時(shí)間:2024/9/20 47 豆豆
生活随笔 收集整理的這篇文章主要介紹了 .NET WebBrowser不与IE或其他进程共享cookie(WebBrowser独立cookie方法) 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
[DllImport("wininet.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)]public static extern bool InternetSetOption(int hInternet, int dwOption, IntPtr lpBuffer, int dwBufferLength);然后在程序啟動(dòng)函數(shù)處調(diào)用以下函數(shù):private 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 !>?");} }

總結(jié)

以上是生活随笔為你收集整理的.NET WebBrowser不与IE或其他进程共享cookie(WebBrowser独立cookie方法)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。