당신은 InternetSetOption
Win32 함수를 사용하여 프로세스 당이 작업을 수행 할 수 있습니다 :
[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 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 !>?");
}
}
는 스레드 당이 작업을 수행하는 것이 가능을? – EBAG
나는 그렇게 생각하지 않는다. 결국 당신이 사용하는 WebBrowser 컨트롤이 Internet Explorer를 나타내는 네이티브 COM 개체에 대한 래퍼 일뿐이라는 것을 잊지 마십시오. –
쿠키 공유에 관해서는 스레드 단위로도 가능하다고 생각하지 않습니다. 이 세션은 WebBrowser 인스턴스의 프로세스별로 공유됩니다. 다음은 비슷한 [질문]입니다 (http://stackoverflow.com/questions/18055734/net-webbrowser-control-and-dispose/18057266#18057266). – Noseratio