ASP.NET¿çÒ³Ãæ´«Öµ¼¼ÇÉ×ܽá
¹ØÓÚÒ³Ãæ´«ÖµµÄ·½·¨£¬Òý·¢Á˺ܶàÌÖÂÛ¡£¿´À´ÓкܶàÈ˹Ø×¢Õâ¸ö£¬ÎÒ¾ÍÎÒ¸öÈ˹۵ã×öÁËЩ×ܽᣬϣÍû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
1. ʹÓÃQueryString±äÁ¿
QueryStringÊÇÒ»Öַdz£¼òµ¥µÄ´«Öµ·½Ê½£¬Ëû¿ÉÒÔ½«´«Ë͵ÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖС£Èç¹ûÊÇ´«µÝÒ»¸ö»ò¶à¸ö°²È«ÐÔÒªÇ󲻸߻òÊǽṹ¼òµ¥µÄÊýֵʱ£¬¿ÉÒÔʹÓÃÕâ¸ö·½·¨¡£µ«ÊǶÔÓÚ´«µÝÊý×é»ò¶ÔÏóµÄ»°£¬¾Í²»ÄÜÓÃÕâ¸ö·½·¨ÁË¡£ÏÂÃæÊÇÒ»¸öÀý×Ó£º
a.aspxµÄC#´úÂë
private void Button1_Click(object sender, System.EventArgs e)
{
string s_url;
s_url = "b.aspx?name=" + Label1.Text;
Response.Redirect(s_url);
}
b.aspxÖÐC#´úÂë
private void Page_Load(object sender, EventArgs e)
{
Label2.Text = Request.QueryString["name"];
}
2. ʹÓÃApplication ¶ÔÏó±äÁ¿
Application¶ÔÏóµÄ×÷Ó÷¶Î§ÊÇÕû¸öÈ«¾Ö£¬Ò²¾ÍÊÇ˵¶ÔËùÓÐÓû§¶¼ÓÐЧ¡£Æä³£Óõķ½·¨ÓÃLockºÍUnLock¡£
a.aspxµÄC#´úÂë
private void Button1_Click(object sender, System.EventArgs e)
{
Application["name"] = Label1.Text;
Server.Transfer("b.aspx");
}
b.aspxÖÐC#´úÂë
private void Page_Load(object sender, EventArgs e)
{
string name;
Application.Lock();
name = Application["name"].ToString();
Application.UnLock();
}
3. ʹÓÃSession±äÁ¿
Ïë±ØÕâ¸ö¿Ï¶¨ÊÇ´ó¼ÒʹÓÃÖÐ×î³£¼ûµÄÓ÷¨ÁË£¬Æä²Ù×÷ÓëApplicationÀàËÆ£¬×÷ÓÃÓÚÓû§¸öÈË£¬ËùÒÔ£¬¹ýÁ¿µÄ´æ´¢»áµ¼Ö·þÎñÆ÷ÄÚ´æ×ÊÔ´µÄºÄ¾¡¡£
a.aspxµÄC#´úÂë
private void Button1_Click(object sender, System.EventArgs e)
{
Session["name"] = Label.Text;
}
b.aspxÖÐC#´úÂë
private void Page_Load(object sender, EventArgs e)
{
string name;
name = Session["name"].ToString();
}
4. ʹÓÃCookie¶ÔÏó±äÁ¿
Õâ¸öÒ²ÊÇ´ó¼Ò³£Ê¹Óõķ½·¨£¬ÓëSessionÒ»Ñù£¬ÆäÊÇʲ¶Ôÿһ¸öÓû§¶øÑԵģ¬µ«ÊÇÓиö±¾ÖʵÄÇø±ð£¬¼´CookieÊÇ´æ·ÅÔÚ¿Í»§¶ËµÄ£¬¶øsessionÊÇ´æ·ÅÔÚ·þÎñÆ÷¶ËµÄ¡£¶øÇÒCookieµÄʹÓÃÒªÅäºÏASP.NETÄÚÖöÔÏóRequestÀ´Ê¹Óá£
a.aspxµÄC#´úÂë
private void Button1_Click(objec
Ïà¹ØÎĵµ£º
ÔÚ¿ª·¢ÐèÒªÓû§×¢²áºó²ÅÄÜʹÓÃÌṩµÄ¸÷ÏÄܵÄÓ¦ÓóÌÐòʱ£¬ÔÚÐÂÓû§Ìá½»×¢²áÐÅÏ¢ºó£¬½Ï³£¼ûµÄ×ö·¨ÊÇÓɳÌÐòÉú³ÉËæ»úÃÜÂ룬Ȼºó·¢ËÍÃÜÂëµ½Óû§×¢²áʱÌîдµÄµç×ÓÐÅÏ䣬Óû§ÔÙÓÃÊÕµ½µÄÃÜÂëÀ´¼¤»îÆäÕÊ»§¡£
ʵÏÖASP.NETÉú³ÉËæ»úÃÜÂ빦ÄÜÊǺÜÈÝÒ׵ģ¬ÏÂÃæµÄ´úÂë¸ø³öÁËÍêÕûµÄʵÏÖ·½·¨£º
public static string MakePasswor(string ......
1.
ÈÏÖ¤ÓëÊÚȨ»úÖÆ
l
ASP.NET 2.0°²È«±ØÒªÐÔ
¶ÔÓÚÍøÕ¾¶øÑÔ£¬Óû§Éí·ÝÈÏÖ¤ÓëȨÏÞ¹ÜÀíÊǷdz£ÖØÒªµÄ²¿·Ö¡£Í¨¹ýÓû§ÃûºÍÃÜÂ룬¶ÔÓû§½øÐÐÉí·ÝÑéÖ¤£¬²¢Ö¸ÅÉËû¿É·ÃÎʵÄ×ÊÔ´£¬Õⲿ·Ö¹¤×÷Ò»Ö±¶¼ÊÇÍøÕ¾¿ª·¢µÄÖØÒªÄÚÈÝ¡£
ÔÚÁíÍâһЩÇé¿ö ......
Asp.NetÏÂÔØ·½·¨¡¡²Î¿¼
(1) Ê×ÏÈ×ö³ÉÏÂÔØÎļþ¡£
¡£¡£¡£ ¡£¡£¡£
(2) ×ö³ÉÏÂÔØÎļþµÄ·¾¶ÒÔ¼°ÎļþÃûÓÃsession´«µÝ¸ø´ò¿ªÒ³Ãæ
Session["FILE_PATH"] = ·¾¶ + "DownLoadFile.txt";
Session["FILE_NAME"] = "DownLoadFile.txt";
(3) ´ò¿ªÐ ......
c#£¨»òvb.net£©³ÌÐò¸Ä½ø
1¡¢Ê¹ÓÃÖµÀàÐ͵ÄToString·½·¨
¡¡¡¡ÔÚÁ¬½Ó×Ö·û´®Ê±£¬¾³£Ê¹ÓÃ"+"ºÅÖ±½Ó½«Êý×ÖÌí¼Óµ½×Ö·û´®ÖС£ÕâÖÖ·½·¨ËäÈ»¼òµ¥£¬Ò²¿ÉÒԵõ½ÕýÈ·½á¹û£¬µ«ÊÇÓÉÓÚÉæ¼°µ½²»Í¬µÄÊý¾ÝÀàÐÍ£¬Êý×ÖÐèҪͨ¹ý×°Ïä²Ù×÷ת»¯ÎªÒýÓÃÀàÐͲſÉÒÔÌí¼Óµ½×Ö·û´®ÖС£µ«ÊÇ×°Ïä²Ù×÷¶ÔÐÔÄÜÓ°Ïì½Ï´ó£¬ÒòΪÔÚ½øÐÐÕâÀà´¦Àíʱ£¬½«ÔÚÍйܶÑÖÐ ......