📜  c# webrequest cookies - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:02.354000             🧑  作者: Mango

代码示例1
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.