ѧϰasp.net C#
1¡¢DateTime Êý×ÖÐÍ
System.DateTime currentTime=new System.DateTime();
¡¡¡¡1.1 È¡µ±Ç°ÄêÔÂÈÕʱ·ÖÃë
currentTime=System.DateTime.Now;
¡¡¡¡1.2 È¡µ±Ç°Äê
int Äê=currentTime.Year;
¡¡¡¡1.3 È¡µ±Ç°ÔÂ
int ÔÂ=currentTime.Month;
¡¡¡¡1.4 È¡µ±Ç°ÈÕ
int ÈÕ=currentTime.Day;
¡¡¡¡1.5 È¡µ±Ç°Ê±
int ʱ=currentTime.Hour;
¡¡¡¡1.6 È¡µ±Ç°·Ö
int ·Ö=currentTime.Minute;
¡¡¡¡1.7 È¡µ±Ç°Ãë
int Ãë=currentTime.Second;
¡¡¡¡1.8 È¡µ±Ç°ºÁÃë
int ºÁÃë=currentTime.Millisecond;
£¨±äÁ¿¿ÉÓÃÖÐÎÄ£©
¡¡¡¡1.9 È¡ÖÐÎÄÈÕÆÚÏÔʾ——ÄêÔÂÈÕʱ·Ö
string strY=currentTime.ToString( "f "); //²»ÏÔʾÃë
¡¡¡¡1.10 È¡ÖÐÎÄÈÕÆÚÏÔʾ_ÄêÔÂ
string strYM=currentTime.ToString( "y ");
¡¡¡¡1.11 È¡ÖÐÎÄÈÕÆÚÏÔʾ_ÔÂÈÕ
string strMD=currentTime.ToString( "m ");
¡¡¡¡1.12 È¡µ±Ç°ÄêÔÂÈÕ£¬¸ñʽΪ£º2003-9-23
string strYMD=currentTime.ToString( "d ");
¡¡¡¡1.13 È¡µ±Ç°Ê±·Ö£¬¸ñʽΪ£º14£º24
string strT=currentTime.ToString( "t ");
¡¡¡¡2¡¢×Ö·ûÐÍת»» תΪ32λÊý×ÖÐÍ
¡¡¡¡Int32.Parse(±äÁ¿) Int32.Parse( "³£Á¿ ")
¡¡¡¡3¡¢ ±äÁ¿.ToString()
¡¡¡¡×Ö·ûÐÍת»» תΪ×Ö·û´®
¡¡¡¡12345.ToString( "n "); //Éú³É 12,345.00
¡¡¡¡12345.ToString( "C "); //Éú³É £¤12,345.00
¡¡¡¡12345.ToString( "e "); //Éú³É 1.234500e+004
¡¡¡¡12345.ToString( "f4 "); //Éú³É 12345.0000
¡¡¡¡12345.ToString( "x "); //Éú³É 3039 (16½øÖÆ)
¡¡¡¡12345.ToString( "p "); //Éú³É 1,234,500.00%
¡¡¡¡4¡¢±äÁ¿.Length Êý×ÖÐÍ
¡¡¡¡È¡×Ö´®³¤¶È
Ïà¹ØÎĵµ£º
/*
±¾¶Î´úÂëÔÚ¹«Ë¾ÏîÄ¿ÖÐʵ¼ÊÔ¶³Ìµ÷ÓõÚÈý·½¹«Ë¾ÌṩµÄC#¿ª·¢WebServiceµÄʾÀý
*/
/**
* µÇ¼ÓÎÏ·
*
* @param paramPN
* @param paramTerraceID
* @param paramSvrID
*/
private String loginGame(String paramPN, HttpServletRequest req){
&n ......
1 response.redirect Õâ¸öÌøתҳÃæµÄ·½·¨ÌøתµÄËٶȲ»¿ì£¬ÒòΪËüÒª×ß2¸öÀ´»Ø£¨2´Îpostback£©£¬µ«Ëû¿ÉÒÔÌø תµ½ÈκÎÒ³Ã棬ûÓÐÕ¾µãÒ³ÃæÏÞÖÆ£¨¼´¿ÉÒÔÓÉÑÅ»¢Ìøµ½ÐÂÀË£©£¬Í¬Ê±²»ÄÜÌø¹ýµÇ¼±£»¤¡£µ«ËÙ¶ÈÂýÊÇÆä×î´óȱÏÝ£¡redirectÌøת»úÖÆ£ºÊ×ÏÈÊÇ·¢ËÍÒ»¸öhttpÇëÇ󵽿ͻ§¶Ë£¬Í¨ÖªÐèÒªÌøתµ½ÐÂÒ³Ã棬Ȼºó¿Í»§¶ËÔÚ·¢ËÍÌøת ......
·½·¨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 ......
Ôø¾ÈÏΪ£¬Ñ§ºÃCÓïÑÔ´ò±éÌìÏÂÎÞµÐÊÖ¡£ ºóÀ´·¢ÏÖΪÁËÃæÏò¶ÔÏ󣬲»µÃ²»ÓÃC++£¬ºóÀ´·¢ÏÖÃæÏò¶ÔÏó¹ûÈ»ÊǷdz£Î°´óµÄ˼Ï룡 ÔÙºóÀ´£¬´ÓVS6.0Õâ¸ö°æ±¾Ö®ºó£¬VC¾ÍÒѾûÓÐʲô̫´óµÄ±ä»¯ÁË£¬MFCµÈµÈ¶¼ÒѾÎȶ¨ÏÂÀ´ÁË£¬Î¢Èí²»ÍæÁË£¬Î¢ÈíÅܵ½.netƽ̨ÉÏÃæÈ¥ÍæÁË£¡£¡Î¢ÈíһЩеÄÓ¦Óã¬È«²¿¶¼Åܵ½.netƽ̨ÉÏÈ¥ÁË£¬VCƽ̨¸öÈ˾õµÃ¾ÍÊ£ ......
ÅäÖÃÎļþ¿ÉÓÃÀ´´æ·ÅһЩ¶à´ÎÓõ½µÄ³£Á¿Êý¾Ý£¬ÈçÁ¬½Ó´®£º
<appSettings>
<add key="connStr1" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="/>
<add key="connStr2" value="App_Data\test.mdb"/>
</appSettings>
Õâ¸öÅäÖÃÊý¾Ý¿âÁ¬½Ó´®
ʹÓÃʾÀý£º
public class DBCo ......