public CookieContainer GetCookies(string url) { ManualResetEvent ready = new ManualResetEvent(false); CookieContainer cc = null; RunSTAThreaded( () => { var wnd = new BrowserWindow { NavigateUrl = url }; Application.Run(wnd); cc = wnd.CookieContainer; ready.Set(); }); ready.WaitOne(10000); return(cc); }
public CookieContainer GetCookies(string url) { ManualResetEvent ready = new ManualResetEvent(false); CookieContainer cc = null; RunSTAThreaded( () => { var wnd = new BrowserWindow { NavigateUrl = url }; Application.Run(wnd); cc = wnd.CookieContainer; ready.Set(); }); ready.WaitOne(10000); return cc; }