Cookies
Write:
HttpCookie nc=new HttpCookie ("Newcookie");//--instantiate httpcookienc.values["name"] =xx;//--assignment Response.cookies.Add (NC); /--Write
Read:
HttpCookie Getcook=request. cookies["Newcookie"]; Response.Write (getcook.value["name"]);
Application
1. Set initial value application["a"]= 0 in Global
2. Load the page inside,
Application.Lock (); Application["a"] = (int) application["a"] + 1; The object type is strongly converted to an integer type Application.UnLock ();//Unlock Response.Write (Application ["a"]);
3.global
void Application_Start (object sender, EventArgs e) { //code that runs at application startup Application.Lock (); Application["a"] = 0; Application.UnLock (); }
Session
1. Create: Global with Application
2. Front desk call directly: Response.Write ("<br>" +session["name"]);
Cookie,session,application--[asp.net]