Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ѧϰ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#: ÌáÈ¡ÍøÒ³ÖеÄjavascript´úÂë

public static void Main()
        {
            WebRequest req = WebRequest.Create("http://blog.csdn.net/xiaofengsheng");
            try
  & ......

Asp.net ÖÐ CookieµÄʹÓ÷½·¨

·½·¨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++ > C#

Ôø¾­ÈÏΪ£¬Ñ§ºÃCÓïÑÔ´ò±éÌìÏÂÎÞµÐÊÖ¡£ ºóÀ´·¢ÏÖΪÁËÃæÏò¶ÔÏ󣬲»µÃ²»ÓÃC++£¬ºóÀ´·¢ÏÖÃæÏò¶ÔÏó¹ûÈ»ÊǷdz£Î°´óµÄ˼Ï룡 ÔÙºóÀ´£¬´ÓVS6.0Õâ¸ö°æ±¾Ö®ºó£¬VC¾ÍÒѾ­Ã»ÓÐʲô̫´óµÄ±ä»¯ÁË£¬MFCµÈµÈ¶¼ÒѾ­Îȶ¨ÏÂÀ´ÁË£¬Î¢Èí²»ÍæÁË£¬Î¢ÈíÅܵ½.netƽ̨ÉÏÃæÈ¥ÍæÁË£¡£¡Î¢ÈíһЩеÄÓ¦Óã¬È«²¿¶¼Åܵ½.netƽ̨ÉÏÈ¥ÁË£¬VCƽ̨¸öÈ˾õµÃ¾ÍÊ£ ......

ASP.NETÖеÄEval£¨£©ºÍDataBinder.Eval£¨£©·½·¨

Eval( " ")ºÍBind( " ")¡¡ÕâÁ½ÖÖÒ»¸öµ¥Ïò°ó¶¨£¬Ò»¸öË«Ïò°ó¶¨
bindÊÇË«Ïò°ó¶¨,µ«ÐèÊý¾ÝÔ´¿É¸ü¸Ä²ÅÄÜÓÃ
ASP.NET 2.0¸ÄÉÆÁËÄ£°åÖеÄÊý¾Ý°ó¶¨²Ù×÷£¬°Ñv1.xÖеÄÊý¾Ý°ó¶¨Óï·¨DataBinder.Eval(Container.DataItem, fieldname)¼ò»¯ÎªEval(fieldname)¡£Eval·½·¨ÓëDataBinder.EvalÒ»Ñù¿ÉÒÔ½ÓÊÜÒ»¸ö¿ÉÑ¡µÄ¸ñʽ»¯×Ö·û´®²ÎÊý¡£Ëõ¶ÌµÄEv ......

ASP.NET ÎļþÏÂÔØ

ÏÂÔØÒ³Ã棺
 <a href="download.ashx?url=<%=Server.UrlEncode("˵Ã÷.txt")%>">ÏÂÔØ</a>
------------------------------------------------------------------------------
download.ashx
<%@ WebHandler Language="C#" Class="download" %>
using System;
using System.Web;
public ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ