📅  最后修改于: 2022-03-11 14:49:02.354000             🧑  作者: Mango
CookieContainer cookieContainer = new CookieContainer();
System.Net.Cookie userNameCookie = new System.Net.Cookie("user", "username");
System.Net.Cookie passwordCookie = new System.Net.Cookie("password", "9848jf7s7ejhd");
cookieContainer.Add(userNameCookie);
cookieContainer.Add(passwordCookie);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(produkt);
request.CookieContainer = cookieContainer;
//multiple cookies.