Asp.netÔ´Âëרҵվ
Ê×Ò³->»áÔ±½»ÓÑ->XMLͬѧ¼ϵͳԴÂ루±ÏÒµÉè¼Æ£©>>Default.aspx.cs>>Ô´ÂëÔÚÏ߲鿴
ÎÂܰÌáʾ£º´úÂëÔÚÏßä¯ÀÀ¹¦ÄÜÖ»ÄÜ×öΪԴÂëä¯ÀÀ²Î¿¼£¬Èç¹ûÏë¸ü½øÒ»²½Á˽â¸Ã´úÂëÇëÏÂÔØ£ºXMLͬѧ¼ϵͳԴÂ루±ÏÒµÉè¼Æ£©
µ±Ç°Îļþ£ºÎļþÀàÐÍ XMLClassBooks/Default.aspx.cs[1K£¬2009-6-12 11:59:52]£¬´ò¿ª´úÂë½á¹¹Í¼
ÆÕͨÊÓͼ
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Web; 5using System.Web.Security; 6using System.Web.UI; 7using System.Web.UI.WebControls; 8using System.Web.UI.WebControls.WebParts; 9using System.Web.UI.HtmlControls; 10 11public partial class _Default : System.Web.UI.Page 12{ 13 protected void Page_Load(object sender, EventArgs e) 14 { 15 if (!IsPostBack) 16 { 17 //¶ÁÈ¡CookieÀïµÄÕʺźÍÃÜÂë 18 HttpCookie cookie = Request.Cookies["userInfo"]; 19 if (cookie != null) 20 { 21 this.userLogin.InnerHtml = "<p>" + cookie.Values["userName"].ToString() + " ͬѧ£¬»¶Ó­Äã»ØÀ´ !<br/><br/><a href='index.aspx'>½øÈëÎÒµÄͬѧ¼</a></p>"; 22 } 23 } 24 } 25 26 //³ÉÔ±µÇ¼ 27 protected void btnLogin_Click(object sender, EventArgs e) 28 { 29 if (IsValid) 30 { 31 string _userName = this.txtUserName.Text.Trim(); 32 string _userPwd = this.txtUserPwd.Text.Trim(); 33 34 //Cookie´æ·Åʱ¼ä 35 int _cookieDay = 0; 36 if (this.cookieYes.Checked) 37 _cookieDay = 14; //±£´æCookie 38 else 39 _cookieDay = 0; //²»±£´æCookie 40 Logic lg = new Logic(); //´´½¨LogicÀà¶ÔÏó 41 if (lg.UserLogin(_userName, _userPwd, _cookieDay)) //µ÷ÓÃÑéÖ¤·½·¨ 42 Response.Redirect("index.aspx"); 43 else 44 lg.Msg("ÕʺŻòÃÜÂë´íÎó!"); 45 } 46 } 47} 48
»¹Ã»ÓÐÕÒµ½ÄúÐÄÒǵÄÄÚÈÝ£¿ÇëÓÃ.netÔ´Âë´óËѲ¶
´úÂëÆ¬¶Ï ´ò°üÏÂÔØ¸ÃÏîÄ¿ÍêÕûÔ´Â룺XMLͬѧ¼ϵͳԴÂ루±ÏÒµÉè¼Æ£©
51Aspx.com °æÈ¨ËùÓÐ CopyRight © 2006-2010. ¾©ICP±¸06046876ºÅ ±¾Õ¾·¨ÂɹËÎÊ£ºITlaw-ׯÒãÐÛÂÉʦ
·µ»Ø¶¥²¿
¿Í»§·þÎñ£ºµã»÷ÕâÀï½øÐпͻ§×Éѯ ÒµÎñºÏ×÷£ºµã»÷ÕâÀïǢ̸ҵÎñºÏ×÷ ºÏ×÷ÈÈÏߣº010-68880146