private InternalAdd ( |
||
cookie | ||
isStrict | bool | |
return | int |
CookieCollection cookies = new CookieCollection(); Cookie myCookie = new Cookie("username", "john"); cookies.InternalAdd(myCookie);
CookieCollection cookies = new CookieCollection(); cookies.InternalAdd(new Cookie("username", "john")); cookies.InternalAdd(new Cookie("loginstatus", "1"));In this example, two cookies are added to the collection using the InternalAdd method - a cookie named "username" with a value of "john", and a cookie named "loginstatus" with a value of "1". The System.Net.CookieCollection class is a part of the System.Net namespace in the .NET Framework library.