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

C#£¨C sharp£©×Ö·û´®ºÍʱ¼äµÄÏ໥ת»»

C#£¨C sharp£©×Ö·û´®ºÍʱ¼äµÄÏ໥ת»»¡£
 
Ò»¡¢DateTime –> string
ʱ¼äÀàÐÍת»¯³É×Ö·û´®ÀàÐÍ£¬ÄÇÊÇÏ൱µÄ¼òµ¥£¬Ö±½Óµ÷ÓÃToString()·½·¨¼´¿É¡£È磺
DateTime dt = DateTime.Now;
string dtStr = dt.ToString();
 
Èç¹ûÏë¶ÔÊä³ö¸ñʽ»¯£¬¿ÉÒÔÕâôд£º
dt.ToString("yyyyÄêMMÔÂddÈÕ");        //2005Äê11ÔÂ5ÈÕ
dt.ToString("yyyy-MM-dd");                      //2005-11-5
string.Format("{0:d}",dt);                  //2005-11-5
string.Format("{0:D}",dt);                  //2005Äê11ÔÂ5ÈÕ
 
ʱ¼äÀàÐ͸ñʽ»¯£¨³É×Ö·ûÀàÐÍ£©¿ÉÒÔͨ¹ýÁ½ÖÖ·½Ê½£º1¡¢×Ô¶¨Òåʱ¼ä¸ñʽ¡£×Ô¼º¶¨Òåʱ¼äµÄ¹¹³ÉºÍ±íʾ£»2¡¢±ê׼ʱ¼ä¸ñʽ¡£Óɱê×¼¿âÌṩµÄÓÐÏ޵ıíʾ·½Ê½¡££¨ÏêϸµÄÇé²Î¿¼ÁÐ±í£©
 
¶þ¡¢string -> DateTime
string dtString = “2009-10-12 00:12:05”;
DateTime dt = DateTime.Parse(dtStr);                      //·½Ê½Ò»
DateTime dt2 = Convert.ToDateTime(dtStr);              //·½Ê½¶þ
 
µ±È»DateTimeÒ²ÓжàÖÖ±íʾ·½Ê½£¨·Ç¸ñʽ»¯³É×Ö·û´®ÀàÐÍ£©£¬È磺
dt.ToFileTimeUtc();                  //127756704859912816
dt.ToLocalTime();                    //2005-11-5 21:21:25
dt.ToLongDateString();            //2005Äê11ÔÂ5ÈÕ
 
µ±È»Èç¹û×îºóÒª´òÓ¡³öÀ´£¬¾ÍÐèÒªToString()һϣ¬×ª»¯³É×Ö·û´®ÀàÐÍ¡£
 
Èý¡¢Ê±¼äµÄÆäËü·½·¨£¬ÊôÐÔºÍÔËËã
dt.Year //2005
dt.Date


Ïà¹ØÎĵµ£º

c#ÖеÄAjaxÉÏÊÖƪ£­£­£­·Çͬ²½ÇëÇóresponseText

ÏÈÀ´Ð´Ò»¸ö¼òµ¥µÄAjax³ÌÐò£¬Ê¹Ó÷Çͬ²½µÄ·½Ê½Ïò·þÎñÆ÷¶ËÈ¡µÃTXTÎļþÖеÄÄÚÈÝ£¬²¢¼ÓÒÔÏÔʾ¡£Ê×ÏÈ£¬Çë×¼±¸Ò»¸öHelloAjax.aspx(HTMLÒ²¿É)£º
*HelloAjax.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HelloAjax.aspx.cs" Inherits="HelloAjax._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD ......

c#ÖеÄAjaxÉÏÊÖƪ£­£­£­·Çͬ²½ÇëÇóresponseXML

ÉÏƪ½éÉÜÁËÈçºÎÔÚAjax¿Í»§¶ËÓë·þÎñÆ÷¶ËÖ®¼ä´«Ëͼòµ¥µÄÎı¾Êý¾Ý£¬Æäʵ£¬Ò²¿ÉÒÔʹÓÃXML×÷ΪÊý¾Ý´«ËÍ¡¢¹µÍ¨µÄ¸ñʽ£¬Ajax¿Í»§¶ËÈôÒª·¢ËÍXML£¬»ù±¾ÉϾÍÊǽ«XML×÷Ϊ×Ö·û´®£¬ÔÚPOSTÇëÇóʱ·¢ËÍ£¬ÀýÈ磺
*HelloAjax.js
var xmlHttp;
function createXMLHttpRequest() {
if (window.XMLHttpRequest) {
xmlHttp = new ......

C/C++Êý×éÃûÓëÖ¸ÕëÇø±ðÉîÈë̽Ë÷

 ÒýÑÔ
¡¡¡¡Ö¸ÕëÊÇC/C++ÓïÑÔµÄÌØÉ«£¬¶øÊý×éÃûÓëÖ¸ÕëÓÐÌ«¶àµÄÏàËÆ£¬ÉõÖÁºÜ¶àʱºò£¬Êý×éÃû¿ÉÒÔ×÷ΪָÕëʹÓá£ÓÚÊǺõ£¬ºÜ¶à³ÌÐòÉè¼ÆÕ߾ͱ»¸ãºýÍ¿ÁË¡£¶øÐí¶àµÄ´óѧÀÏʦ£¬ËûÃÇÔÚCÓïÑԵĽÌѧ¹ý³ÌÖÐÒ²´íÎóµÃ¸øѧÉú½²½â£º"Êý×éÃû¾ÍÊÇÖ¸Õë"¡£ºÜÐÒÔË£¬ÎҵĴóѧÀÏʦ¾ÍÊÇÆäÖÐÖ®Ò»¡£Ê±ÖÁ½ñÈÕ£¬ÎÒÈÕ¸´Ò»ÈյؽøÐÐ×ÅC/C++ÏîÄ¿µÄ¿ª·¢£¬¶ ......

C/C++±ÊÊÔÌâÄ¿´óÈ«

 1.ÇóÏÂÃ溯ÊýµÄ·µ»ØÖµ£¨Î¢Èí£©
¡¡¡¡int func(x)
¡¡¡¡{
¡¡¡¡int countx = 0;
¡¡¡¡while(x)
¡¡¡¡{
¡¡¡¡countx ++;
¡¡¡¡x = x&(x-1);
¡¡¡¡}
¡¡¡¡return countx;
¡¡¡¡}
¡¡¡¡¼Ù¶¨x = 9999¡£ ´ð°¸£º8
¡¡¡¡Ë¼Â·£º½«xת»¯Îª2½øÖÆ£¬¿´º¬ÓеÄ1µÄ¸öÊý¡£
¡¡¡¡2. ʲôÊÇ“ÒýÓÔ£¿ÉêÃ÷ºÍʹÓÓÒýÓ ......

LINUX CÖÐÓÃdefine¶¨Òå¿É±ä²ÎÊýµÄºê

  Ò»°ãÔÚµ÷ÊÔ´òÓ¡DebugÐÅÏ¢µÄʱºò, ÐèÒª¿É±ä²ÎÊýµÄºê. ´ÓC99¿ªÊ¼¿ÉÒÔʹ±àÒëÆ÷±ê×¼Ö§³Ö¿É±ä²ÎÊýºê(variadic macros), ÁíÍâGCCÒ²Ö§³Ö¿É±ä²ÎÊýºê, µ«ÊÇÁ½ÖÖÔÚϸ½ÚÉÏ¿ÉÄÜ´æÔÚÇø±ð.
1. __VA_ARGS__
        __VA_ARGS__ ½« "..." ´«µÝ¸øºê . Èç
     ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ