Asp.net ÖÐ CookieµÄʹÓ÷½·¨
·½·¨1:
±ÈÈ罨Á¢Ò»¸öÃûΪcnlive£¬ÖµÎª"123"µÄcookie
HttpCookie cookie = new HttpCookie["cnlive"];
cookie.Value = "123";
Response.AppendCookie(cookie);
È¡¸Õ²ÅдÈëµÄCookieÖµ:
HttpCookie cookie = Request.Cookies["cnlive"];
cookieValue = cookie.Value;
ÔÚÒ»¸öCookieÖд¢´æ¶à¸öÐÅÏ¢:
HttpCookie cookie = new HttpCookie("cnlive");
cookie.Values.Add("weburl",http://www.cnlive.net);
cookie.Values.Add("author","honfei");
cookie.Values.Add("sitename","ÍøÓÑÓëýÌå");
Response.AppendCookie(cookie);
¶ÁÈ¡:
HttpCookie cookie = Request.Cookies["cnlive"];
value1 = cookies.Values["weburl"];
value2 = cookies.Values["author"];
.............
·½·¨¶þ:
Response.Cookies["UserID"].Value = "123";//½«Óû§IDдÈëCookie
Response.Cookies["UserID"].Expires = DateTime.Now.AddDays(1);
¶ÁÈ¡·½·¨:
Request.Cookies["UserID"].Value;
дcookie
HttpCookie cookie = new HttpCookie("Info");//¶¨Òåcookie¶ÔÏóÒÔ¼°ÃûΪInfoµÄÏî
DateTime dt = DateTime.Now;//¶¨Òåʱ¼ä¶ÔÏó
TimeSpan ts=new TimeSpan(1,0,0,0);//cookieÓÐЧ×÷ÓÃʱ¼ä£¬¾ßÌå²émsdn
cookie.EXPires = dt.Add(ts);//Ìí¼Ó×÷ÓÃʱ¼ä
cookie.Values.Add("user","cxbkkk");//Ôö¼ÓÊôÐÔ
cookie.Values.Add("userid","1203");
Response.AppendCookie(cookie);//È·¶¨Ð´ÈëcookieÖÐ ¶ÁÈ¡cookie
if(Request.Cookies["Info"]!=null)
{
string temp=Convert.ToString(Request.Cookies["Info"].Values["user"])+" "+Convert.ToString(Request.Cookies["Info"].Values["userid"]);
//¶ÁÈ«²¿¾ÍÓÃRequest.Cookies["Info"].Value)
if(temp=="")
{
Response.Write("¿Õ");
}
else
Response.Write(temp);
}
else
{
Response.Write("error");
} ÐÞ¸Äcookie
Response.Cookies["Info"]["user"] = "2";
Response.Cookies["Info"].Expires = DateTime.Now.AddDays(1);
// ɾ³ýcookieϵÄÊôÐÔ
HttpCookie acookie=Request.Cookies["Info"];
acookie.Values.Remove("userid");
acookie.Expires = DateTime.Now.AddDays(1);
Response.Cookies.Add(acookie); ɾ³ýËùÓÐcookie£¬¾ÍÊÇÉèÖùýÆÚʱ¼äΪÏÖÔÚ¾ÍÐÐÁË
int limit=Request.Cookies.Count - 1;
for(int i=0;i<limit;i++)
{
acookie = Request.Cookies(i)
acookie.Expires = DateTime.N
Ïà¹ØÎĵµ£º
OAÔ´ÂëΪÎÒ¹¤×÷ÊÒ¾«ÐÄ´òÔì,ÓÃÁËÈýÄêµÄʱ¼ä,²ÅÐÞÕýÍêÉƵĴóÐͰ칫ϵͳ.
Ϊ¶ÀÁ¢¿ª·¢,²»´æÔÚ°æȨ¾À·×,²»»á¸øÄú´øÀ´Âé·³,´úÂëÍêÕû£¬Öø×÷ȨµÇ¼ÇºÅ£º2008SR14608.
OA×îÐÂÉý¼¶£¬¹¤×÷Á÷¸üÇ¿´ó£¬±íµ¥¶¨Òå¸üÎȶ¨
ÇëÈÏ×¼ÁªÏµ·½Ê½£¬½÷·À¼Ùð¡£
Ϊ½ÚÔ¼¿ª·¢³É±¾£¬OAÔ´Âë¿ÉÒÔ·ÖÄ£¿é½øÐÐÌṩ
ÓÀ¾Ãά»¤£¬Óг¥2´Î¿ª·¢
Èí¼þ¹¦ÄÜ·ÖΪרҵ° ......
¸ø³öÒ»¸ö×Ö·û´®£¬Èç¡°ÖйúChinaÎÒ°®ÄãI love you¡±£¬³ÌÐò¿ÉÒÔʵÏÖÖÐÓ¢ÎĵÄÇø±ð;
ʶ±ð½á¹ûÈçÏ£º¹²ËĸöÔªËØ
Öйú
China
ÎÒ°®Äã
I love you
string ptn = "[\u4e00-\u9fa5]+|[a-zA-Z\\s]+";
System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(ptn);
s ......
Data Source=sqlservername;Initial Catalog=dbname;User ID=userid;Password=userpwd
Data Source=(local)\\SQLEXPRESS;Initial Catalog=Êý¾Ý¿âÃû;Integrated Security=True
Data Source=(local);Initial Catalog=Êý¾Ý¿âÃû;User ID=ÕʺÅ;Password=ÕʺÅÃÜÂë
Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:\BegASPNET\ ......
¡¡1. Êý¾Ý¿â·ÃÎÊÐÔÄÜÓÅ»¯
¡¡¡¡Êý¾Ý¿âµÄÁ¬½ÓºÍ¹Ø±Õ
¡¡¡¡·ÃÎÊÊý¾Ý¿â×ÊÔ´ÐèÒª´´½¨Á¬½Ó¡¢´ò¿ªÁ¬½ÓºÍ¹Ø±ÕÁ¬½Ó¼¸¸ö²Ù×÷¡£ÕâЩ¹ý³ÌÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»»ÐÅÏ¢ÒÔͨ¹ýÉí·ÝÑéÖ¤£¬±È½ÏºÄ·Ñ·þÎñÆ÷×ÊÔ´¡£ASP.NETÖÐÌṩÁËÁ¬½Ó³Ø(Connection Pool)¸ÄÉÆ´ò¿ªºÍ¹Ø±ÕÊý¾Ý¿â¶ÔÐÔÄܵÄÓ°Ï졣ϵͳ½«Óû§µÄÊý¾Ý¿âÁ¬½Ó·ÅÔÚÁ¬½Ó³ØÖУ¬ÐèҪʱȡ³ö£¬¹Ø± ......
ǰ̨:
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
......