ASP.NETÕýÔò±í´ïʽ¼¯ºÏ
ASP.NETÕýÔò±í´ïʽ¼¯ºÏ
1.ÕʺÅÓÉa¡«zµÄÓ¢ÎÄ×Öĸ(²»Çø·Ö´óСд)¡¢0¡«9µÄÊý×Ö¡¢µã¡¢¼õºÅ»òÏ»®Ïß×é³É£¬³¤¶ÈΪ
3¡«18¸ö×Ö·û£¬ÀýÈç:kyzy_001
^[a-zA-Z0-9.-_]{3,18}$
2.ÊäÈë¿òÀï±ØÐëΪÊý×Ö
^[0-9]{1,}$
3.µç×ÓÓʼþ¸ñʽ
\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
4.ÒªÇóÎı¾¿òÖ»ÄÜÊäÈë×î¶àÁ½Î»Ð¡ÊýµÄÊý×Ö
^[0-9]+.[0-9]{0,2}$
Æ¥Åä24СʱÖÆʱ¼ä
(?<Hour>[0-2]{1}\d{1}):(?<Min>[1-6]{1}\d{1})
Æ¥
Åä±ê×¼ÄêÔ¾§¸ñʽ
^((((((0[48])|([13579][26])|([2468][048]))00)|([0-9][0-9]((0[48])|([13579][26])|([2468][048]))))-02-29)|(((000[1-9])|(00[1-9][0-9])|(0[1-9][0-9][0-9])|([1-9][0-9][0-9][0-9]))-((((0[13578])|(1[02]))-31)|(((0[1,3-9])|(1[0-2]))-(29|30))|(((0[1-9])|(1[0-2]))-((0[1-9])|(1[0-9])|(2[0-8]))))))$
=================================================================================
^\d{5}$
5 ¸öÊýÖµÊý×Ö£¬ÈçÃÀ¹úÓÊÕþ±àÂë¡£
^(\d{5})|(\d{5}-\d{4}$
5
¸öÊýÖµÊý×Ö»ò 5 ¸öÊý×Ö-¶Ì»®Ïß-4 ¸öÊý×Ö¡£Æ¥Åä 5 λÊý×Ö¸ñʽµÄÃÀ¹úÓÊÕþ±àÂ룬»ò 5 λÊý×Ö + 4 λÊý×Ö¸ñʽµÄÃÀ¹úÓÊÕþ±àÂë¡£
^(\d{5}(-\d{4})?$
Óë
Ç°Ò»¸öÏàͬ£¬µ«¸üÓÐЧ¡£Ê¹Óà ? ¿ÉʹģʽÖÐµÄ 4 λÊý×Ö³ÉΪ¿ÉÑ¡²¿·Ö£¬¶ø²»ÊÇÒªÇó·Ö±ð±È½Ï²»Í¬µÄÁ½¸öģʽ£¨Í¨¹ýÁíÒ»ÖÖ·½Ê½£©¡£
^[+-]?\d+(\.\d+)?$
Æ¥
ÅäÈÎÒâÓпÉÑ¡·ûºÅµÄʵÊý¡£
^[+-]?\d*\.?\d*$
ÓëÉÏÒ»¸öÏàͬ£¬µ«Ò²Æ¥Åä¿Õ×Ö·û´®¡£
^(20|21|22|23|[01]\d):[0-5]\d$
Æ¥
Åä 24 СʱÖÆʱ¼äÖµ¡£
/\*.*\*/
Æ¥Åä C ÓïÑÔ·ç¸ñµÄ×¢ÊÍ /* ... */
ÈÕÆÚʱ¼äÅжÏÕýÔò±í´ïʽ
ÕâÀïÊÇÅжÏYYYY-MM-DDÕâÖÖ¸ñʽµÄ£¬»ù±¾ÉÏ°ÑÈòÄêºÍ2ÔµȵÄÇé¿ö¶¼¿¼ÂǽøÈ¥ÁË¡£
^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))$
ÏÂÃæµÄÊǼÓÁËʱ¼äÑéÖ¤µÄ
^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-
Ïà¹ØÎĵµ£º
ASP.NETµÇ½¿Ø¼þ±È½Ï¶à£¬·â×°Á˴󲿷ÖWEBÓ¦ÓÃÖÐҪʵÏÖϵͳµÇ½µÄϵÁй¦ÄÜ£¬Éæ¼°µ½ºÜ¶à·½Ãæ¡£ÖÚ¶à ASP.NET µÇ¼¿Ø¼þÒ»ÆðΪ ASP.NET Web Ó¦ÓóÌÐòÌṩ¿É¿¿µÄÎÞÐè±à³ÌµÄµÇ¼½â¾ö·½°¸¡£Ä¬ÈÏÇé¿öÏ£¬µÇ¼¿Ø¼þÓë ASP.NET ³ÉÔ±×ʸñºÍ Forms Éí·ÝÑéÖ¤¼¯³É£¬ÒÔ°ïÖúʹÍøÕ¾µÄÓû§Éí·ÝÑéÖ¤¹ý³Ì×Ô¶¯»¯¡£Ä¬ÈÏÇé¿öÏ£¬ASP.NET µÇ¼¿Ø¼þÒÔ´¿ ......
ASP.NET Cookie ¸ÅÊö
Cookie ÌṩÁËÒ»ÖÖÔÚ Web Ó¦ÓóÌÐòÖд洢Óû§Ìض¨ÐÅÏ¢µÄ·½·¨¡£ÀýÈ磬µ±Óû§·ÃÎÊÄúµÄÕ¾µãʱ£¬Äú¿ÉÒÔʹÓà Cookie ´æ´¢Óû§Ê×Ñ¡Ïî»òÆäËûÐÅÏ¢¡£µ±¸ÃÓû§ÔٴηÃÎÊÄúµÄÍøվʱ£¬Ó¦ÓóÌÐò±ã¿ÉÒÔ¼ìË÷ÒÔÇ°´æ´¢µÄÐÅÏ¢¡£
ʲôÊÇ Cookie£¿
Cookie ÊÇһС¶ÎÎı¾ÐÅÏ¢£¬°éËæ×ÅÓû§ÇëÇóºÍÒ³ÃæÔÚ Web ·þÎñÆ÷ºÍä¯ÀÀÆ÷Ö® ......
¹ØÓÚÊý¾Ý´¦ÀíÏà¹ØµÄÓÅ»¯
Ò»¡¢ SqlDataReadºÍDatasetµÄÑ¡Ôñ
SqldatareadÓŵ㣺¶ÁÈ¡Êý¾Ý·Ç³£¿ì¡£Èç¹û¶Ô·µ»ØµÄÊý¾Ý²»Ðè×ö´óÁ¿´¦ÀíµÄÇé¿öÏ£ ......
1.
ClientScript.RegisterStartupScript(this.GetType(), "js1", "alert('ɾ³ý³É¹¦');window.location='QuerySortList.aspx';", true);
2.
this.cmdSave.Attributes.Add("onclick", "return f_StringCheck()"); ......
¸øÒ³ÃæµÄTextBoxÉèÖÃReadOnly="True"ʱ,ÔÚºǫ́´úÂëÖв»Äܸ³ÖµÈ¡Öµ,ϱ߼¸ÖÖ·½·¨¿ÉÒÔ±ÜÃâ:
1¡¢²»ÉèÖÃReadOnly,ÉèÖÃonfocus=this.blur()
C#´úÂë
<asp:TextBox ID="TextBox1" runat="server" onfocus=this.blur()></asp:TextBox>
<asp:TextBox ID="TextBox1" runat="serve ......