Cookie usage is similar to ASP.
For example, we create a cookie named aspcn with the value of flying knife.
HttpCookie = new HttpCookie ["aspcn"];
Cookie. Value = "Flying knife ";
Response. AppendCookie (cookie );
It's easy to retrieve the Cookie value.
HttpCookie cookie = Request. Cookies ["aspcn"];
CookieValue = cookie. Value;
Sometimes we want to store multiple pieces of information in a Cookie. For example, we add multiple information under the cookie named aspcn.
HttpCookie cookie = new HttpCookie ("aspcn ");
Cookie. Values. Add ("webmaster", "Flying knife ");
Cookie. Values. Add ("writer", "beige ");
Cookie. Values. Add ("LinkColor", "blue ");
Response. AppendCookie (cookie );
Retrieving information is as easy as possible
HttpCookie cookie = Request. Cookies ["aspcn"];
Value1 = cookies. Values ["webmaster"];
Value2 = cookies. Values ["writer"];
View State
This is a new concept. Its usage is the same as Session. Its main purpose is to record the status of Web Control. Although it is new, it is no different from the Application and Session usage, so I don't want to explain it in detail.
State ["DropLoadIndex"] = 0;
The basic usage is as follows. This is useless after it is released, because it only saves the status of the WEB control.