asp.net»ñÈ¡µ±Ç°Ê±¼ä
ÔÚc# / ASP.netÖÐÎÒÃÇ¿ÉÒÔͨ¹ýʹÓÃDataTimeÕâ¸öÀàÀ´»ñÈ¡µ±Ç°µÄʱ¼ä¡£Í¨¹ýµ÷ÓÃÀàÖеĸ÷ÖÖ·½·¨ÎÒÃÇ¿ÉÒÔ»ñÈ¡²»Í¬µÄʱ¼ä£ºÈ磺ÈÕÆÚ£¨2008-09-04£©¡¢Ê±¼ä£¨12£º12£º12£©¡¢ÈÕÆÚ+ʱ¼ä£¨2008-09-04 12£º11£º10£©µÈ¡£
//»ñÈ¡ÈÕÆÚ+ʱ¼ä
DateTime.Now.ToString(); // 2008-9-4 20:02:10
DateTime.Now.ToLocalTime().ToString(); // 2008-9-4 20:12:12
//»ñÈ¡ÈÕÆÚ
DateTime.Now.ToLongDateString().ToString(); // 2008Äê9ÔÂ4ÈÕ
DateTime.Now.ToShortDateString().ToString(); // 2008-9-4
DateTime.Now.ToString("yyyy-MM-dd"); // 2008-09-04
DateTime.Now.Date.ToString(); // 2008-9-4 0:00:00
//»ñȡʱ¼ä
DateTime.Now.ToLongTimeString().ToString(); // 20:16:16
DateTime.Now.ToShortTimeString().ToString(); // 20:16
DateTime.Now.ToString("hh:mm:ss"); // 08:05:57
DateTime.Now.TimeOfDay.ToString(); // 20:33:50.7187500
//ÆäËû
DateTime.ToFileTime().ToString(); // 128650040212500000
DateTime.Now.ToFileTimeUtc().ToString(); // 128650040772968750
DateTime.Now.ToOADate().ToString(); // 39695.8461709606
DateTime.Now.ToUniversalTime().ToString(); // 2008-9-4 12:19:14
DateTime.Now.Year.ToString(); »ñÈ¡Äê·Ý // 2008
DateTime.Now.Month.ToString(); »ñÈ¡ÔÂ·Ý // 9
DateTime.Now.DayOfWeek.ToString(); »ñÈ¡ÐÇÆÚ // Thursday
DateTime.Now.DayOfYear.ToString(); »ñÈ¡µÚ¼¸Ìì // 248
DateTime.Now.Hour.ToString(); »ñȡСʱ // 20
DateTime.Now.Minute.ToString(); »ñÈ¡·ÖÖÓ // 31
DateTime.Now.Second.ToString(); »ñÈ
Ïà¹ØÎĵµ£º
ʹÓÃASP.Net FormsģʽʵÏÖWebServiceÉí·ÝÑéÖ¤
ÔÚ°²È«ÐÔÒªÇó²»ÊǺܸߵÄASP.Net³ÌÐòÖУ¬»ùÓÚFormsµÄÉí·ÝÑéÖ¤ÊǾ³£Ê¹ÓõÄÒ»ÖÖ·½Ê½£¬¶øÈç¹ûÐèÒª¶ÔWebService½øÐÐÉí·ÝÑéÖ¤£¬×î³£ÓõĿÉÄÜÊÇ»ùÓÚSoap ±êÍ·µÄ×Ô¶¨ÒåÉí·ÝÑéÖ¤·½Ê½¡£Èç¹û¶ÔÁ½Õß×öһϱȽϵĻ°£¬ÏÔÈ»£¬»ùÓÚFormsµÄÑéÖ¤·½Ê½¸ü¼Ó·½±ãÒ×Óã¬ÄÜ·ñ½«F ......
WebÒ³ÃæÊÇÎÞ״̬µÄ£¬ ·þÎñÆ÷¶Ôÿһ´ÎÇëÇó¶¼ÈÏΪÀ´×Ô²»Í¬Óû§£¬Òò´Ë£¬±äÁ¿µÄ״̬ÔÚÁ¬Ðø¶ÔͬһҳÃæµÄ¶à´ÎÇëÇóÖ®¼ä»òÔÚÒ³ÃæÌøתʱ²»»á±»±£Áô¡£ÔÚÓÃASP.NET Éè¼Æ¿ª·¢Ò»¸öWebϵͳʱ£¬ Óöµ½Ò»¸öÖØÒªµÄÎÊÌâÊÇÈçºÎ±£Ö¤Êý¾ÝÔÚÒ³Ãæ¼ä½øÐÐÕýÈ·¡¢°²È«ºÍ¸ßЧµØ´«ËÍ£¬Asp.net ÌṩÁË״̬¹ÜÀíµÈ¶àÖÖ¼¼ÊõÀ´½â¾ö±£´æºÍ´«µÝÊý¾ÝÎÊÌ⣬ÒÔÏÂÀ´Ì½ ......
ÔÚ¿ª·¢Öб£³ÖÁ¼ºÃµÄ±àÂë¹æ·¶ÊÇÊ®·ÖÖØÒªµÄ¡£ÎÒËù²ÉÓõÄеÄVB.net/ASP.NET±àÂë¹æ·¶£¬ÊÇÒ»ÖÖ±»Ö¤Ã÷ÄÜÃ÷ÏÔ¸ÄÉÆ´úÂë¿É¶ÁÐÔ£¬²¢ÓÐÖúÓÚ´úÂë¹ÜÀí¡¢·ÖÀàµÄ±àÂë¹æ·¶¡£²ÉÓÃÕâÖÖ±àÂë¹æ·¶£¬ÄܱÜÃâÈçÐÙÑÀÀûÃüÃû·¨´øÀ´µÄ·±³¤Ç°×º£¬±ãÓÚ¼ÇÒä±äÁ¿µÄÓÃ;¡£ÏÂÃæµÄ½éÉÜÕâÖÖ±àÂë¹æ·¶¡£
Ò»¡¢ÀàÐͼ¶µ¥Î»µÄÃüÃû
1¡¢Àà
¡õÒÔClassÉùÃ÷µÄÀ࣬¶¼±ØÐë ......
²»¹ÜʹÓÃʲôÀ´¿ª·¢³ÌÐò£¬¶¼ÉÙ²»ÁËÐèÒª×ö·ÖÒ³£¬Ä¿Ç°Ê¹ÓÃasp.net
mvc¿ª·¢µÄwebÓ¦ÓóÌÐòµÄÈËÔ½À´Ô½¶àÁË£¬ÏàÓ¦µÄ¸¨Öú£¬Ìá¸ß¿ª·¢Ð§ÂʵÄhelper·½·¨¡¢¿Ø¼þ¶¼½«»á³öÏÖ¡£½ñÌìÎÒÏò´ó¼Ò½éÉÜÒ»¿îÔÚasp.net
mvc¿ò¼ÜÖÐʹÓõķÖÒ³¿Ø¼þ¡£±¾ÈËÒ²ÊÇÔÚÐÂÄêµÄʱºò³õ´ÎʹÓ㬵«ÊÇһֱûÓÐÍƼö¸ø´ó¼Ò¡£ÀûÓÃÎåÒ»ÐÝϢʱ¼äÒ²¾Í½éÉܸø´ó¼Ò¡£Éùà ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
¡¡¡¡´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)£¼/script£¾")
¡¡¡¡½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
¡¡¡¡2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1 ......