[ServiceContract()] public interface ICookieContainer
[ServiceContract()] public interface ICookieContainer
// clear profile cookie container project.Profile.CookieContainer.Clear(); // creates new cookie container var cookieContainer = new CookieContainer(); // http request ZennoPoster.HTTP.Request(InterfacesLibrary.Enums.Http.HttpMethod.GET, "https://zennolab.com", cookieContainer: cookieContainer); // check that the project.Profile.CookieContainer is empty for zennolab.com host var strings = project.Profile.CookieContainer.GetPairs("zennolab.com"); if (items.Count() != 0) throw new Exception("error"); // check that the cookieContainer is NOT empty for zennolab.com host strings = cookieContainer.GetPairs("zennolab.com"); if (items.Count() == 0) throw new Exception("error"); // add the contents of the new container to profile's container project.Profile.CookieContainer.Add(cookieContainer); // check that the project.Profile.CookieContainer is NOT empty for zennolab.com host strings = project.Profile.CookieContainer.GetPairs("zennolab.com"); if (items.Count() == 0) throw new Exception("error"); // check that the project.Profile.CookieContainer is empty for google.com host var items = project.Profile.CookieContainer.Get("google.com"); if (items.Count() != 0) throw new Exception("error"); // navigate to google.com instance.ActiveTab.Navigate("http://google.com"); instance.ActiveTab.WaitDownloading(); // check that the project.Profile.CookieContainer is NOT empty for google.com host items = project.Profile.CookieContainer.Get("google.com"); if (items.Count() == 0) throw new Exception("error");
Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.