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

³£¼ûµÄC#ÃæÊÔÌâ


 
1. ¼òÊö private¡¢ protected¡¢ public¡¢ internal ÐÞÊηûµÄ·ÃÎÊȨÏÞ¡£´ð . private : ˽ÓгÉÔ±, ÔÚÀàµÄÄÚ²¿²Å¿ÉÒÔ·ÃÎÊ¡£ protected : ±£»¤³ÉÔ±£¬¸ÃÀàÄÚ²¿ºÍ¼Ì³ÐÀàÖпÉÒÔ·ÃÎÊ¡£ public : ¹«¹²³ÉÔ±£¬ÍêÈ«¹«¿ª£¬Ã»ÓзÃÎÊÏÞÖÆ¡£ internal: ÔÚͬһÃüÃû¿Õ¼äÄÚ¿ÉÒÔ·ÃÎÊ¡£2 .ÁоÙASP.NET Ò³ÃæÖ®¼ä´«µÝÖµµÄ¼¸ÖÖ·½Ê½¡£ ´ð. 1.ʹÓà QueryString, Èç....?id=1; response. Redirect().... 2.ʹÓà Session ±äÁ¿ 3.ʹÓà Server.Transfer3. Ò»ÁÐÊýµÄ¹æÔòÈçÏÂ: 1¡¢1¡¢2¡¢3¡¢5¡¢8¡¢13¡¢21¡¢34...... ÇóµÚ30λÊýÊǶàÉÙ£¬ÓõݹéË㷨ʵÏÖ¡£´ð£º
public class MainClass {
public static void Main() {
 Console.WriteLine(Foo(30));
 }
public static int Foo(int i){
 if (i return 0; else if(i > 0 && i return 1; else return Foo(i -1) + Foo(i - 2);
 }
 }
4.C#ÖеÄίÍÐÊÇʲô£¿Ê¼þÊDz»ÊÇÒ»ÖÖίÍУ¿´ð £º ίÍпÉÒÔ°ÑÒ»¸ö·½·¨×÷Ϊ²ÎÊý´úÈëÁíÒ»¸ö·½·¨¡£Î¯ÍпÉÒÔÀí½âΪָÏòÒ»¸öº¯ÊýµÄÒýÓá£ÊÇ£¬ÊÇÒ»ÖÖÌØÊâµÄίÍÐ5.override ÓëÖØÔصÄÇø±ð´ð £ºoverride ÓëÖØÔصÄÇø±ð¡£ÖØÔØÊÇ·½·¨µÄÃû³ÆÏàͬ¡£²ÎÊý»ò²ÎÊýÀàÐͲ»Í¬£¬½øÐжà´ÎÖØÔØÒÔÊÊÓ¦²»Í¬µÄÐèÒªoverride  ÊǽøÐлùÀàÖк¯ÊýµÄÖØд¡£ÎªÁËÊÊÓ¦ÐèÒª¡£6.Èç¹ûÔÚÒ»¸öB/S½á¹¹µÄϵͳÖÐÐèÒª´«µÝ±äÁ¿Öµ£¬µ«ÊÇÓÖ²»ÄÜʹÓÃSession¡¢Cookie¡¢Application£¬ÄúÓм¸ÖÖ·½·¨½øÐд¦Àí£¿´ð £º this.Server.Transfer7.Çë±à³Ì±éÀúÒ³ÃæÉÏËùÓÐTextBox¿Ø¼þ²¢¸øËü¸³ÖµÎªstring.Empty£¿´ð£ºforeach (System.Windows.Forms.Control control in this.Controls){if (control is System.Windows.Forms.TextBox){System.Windows.Forms.TextBox tb = (System.Windows.Forms.TextBox)control ; tb.Text = String.Empty ;}}8.Çë±à³ÌʵÏÖÒ»¸öðÅÝÅÅÐòËã·¨£¿´ð£º
int [] array = new int ;
int temp = 0 ;
for (int i = 0 ; i {for (int j = i + 1 ; j {if (array [j] {temp = array [i] ;array [i] = array [j] ;array [j] = temp ;}}}9.ÃèÊöÒ»ÏÂC#ÖÐË÷ÒýÆ÷µÄʵÏÖ¹ý³Ì£¬ÊÇ·ñÖ»Äܸù¾ÝÊý×Ö½øÐÐË÷Òý£¿´ð£º²»ÊÇ¡£¿ÉÒÔÓÃÈÎÒâÀàÐÍ¡£10.ÇóÒÔϱí´ïʽµÄÖµ£¬Ð´³öÄúÏëµ½µÄÒ»ÖÖ»ò¼¸ÖÖʵÏÖ·½·¨£º 1-2+3-4+……+m´ð£ºint Num = this.TextBox1.Text.ToString() ;int Sum = 0 ;for (int i = 0 ; i {if((i%2) == 1){Sum += i ;}else{Sum = Sum - I ;}}System.Console.WriteLine(Sum.ToString());


Ïà¹ØÎĵµ£º

C#²Ù×÷ACCESSÊý¾Ý¿â(´´½¨,ѹËõ,±¸·Ý,»Ö¸´)(תÔØ)

ÏÂÃæÕâ¶ÎC# ´úÂë¿ÉÒÔÓÃÀ´Ñ¹ËõºÍÐÞ¸´AccessÊý¾Ý¿â,²»¹ÜËüÊÇÒ»¸ö¼òµ¥µÄ".mdb"ACCESSÊý¾Ý¿â»¹ÊÇÒ»¸ö".mdw"ÍøÂç¹²ÏíÊý¾Ý¿â,Õâ¸ö¹ý³ÌºÍÄãÔÚÓÃMS AccessÓ¦ÓóÌÐòÖÐʹÓõÄ"¹¤¾ß-Êý¾Ý¿âʵÓù¤¾ß-ѹËõºÍÐÞ¸´"ʱִÐеIJÙ×÷ÍêÈ«Ò»Ñù.ʵÀý´úÂëʹÓÃÁË"³Ù°ó¶¨"(ÔËÐÐÖÐÔÚÄÚ´æÖн¨Á¢COM¶ÔÏó),ÕâÑù¾Í²»ÐèÒªÔÚ¹¤³ÌÖмÓÈëCOMÒýÓÃÁË,Ò²²»ÐèÒªÔÚP ......

c#ºÍjavascript½»»¥

ÔÚasp.net開發ÖУ¬經³£會Óõ½áą́ºÍǰ̨µÄ½»»¥£¬¾Í´Ë總結ÁËÒ»點c#ºÍjavascriptÏ໥²Ù×÷µÄ·½·¨
¡¡¡¡1.ÔÚáą́c#´ú碼ÖÐ調ÓÃjacascriptµÄ·½·¨
¡¡¡¡javascript´ú碼£º
¡¡¡¡<script type="text/javascript" language="javascript">
¡¡¡¡function test()
¡ ......

ÔõÑùÔÚvisual studio.NET ÈÃC,C++,C#´úÂë×Ô¶¯ÅÅÆë

ÎÊÌâÃèÊö£º
C#³ÌÐò,ÀïÃæcopyÁËÐí¶àÔ­À´µÄ´úÂë,ËùÒԲβÆëµÄ,ºÜÄѶÁ,ÈçºÎ²ÅÄÜÈôúÂë×Ô¶¯ÅÅÆë,¾ÍÏóVS   6.0ÖпÉÒÔʹÓÿì½Ý¼ü,·Ç³£·½±ã.
½â´ð£º
ctrl+a,ÏÈÈ«Ñ¡   
ctrl+k,ctrl+f,×Ô¶¯ÅÅÁÐ
»òÕß
ctrl+a,ÏÈÈ«Ñ¡
alt+F8 ×Ô¶¯ÅÅÁÐ ......

Ïê½âVBµ÷ÓÃC#Àà¿âµÄ·½·¨²½Ö裨תÔØ£©

ʹÓÃc#ÓïÑÔÔÚ.netƽ̨Éú³ÉµÄdllÊÇ»ùÓÚMSILµÄ¶þ½øÖÆ´úÂ룬ͨ³£Çé¿öÏÂÊÇÎÞ·¨±»nativeµÄÓïÑԺͳÌÐòµ÷Óõģ¨ÀýÈçvb£¬vc£¬delphi£©¡£µ«ÊÇÒ»°ãÀ´ËµwindowsÉÏnativeµÄ³ÌÐò¶¼ÊÇ¿ÉÒÔÖ±½ÓʹÓÃcom¶ÔÏóµÄ¡£Í¨¹ý.netƽ̨ÌṩµÄһЩ¹¤¾ß£¬¿ÉÒÔΪÆäαÔìÒ»¸öcom½Ó¿Ú²¢×¢²áµ½ÏµÍ³ÖС£´Ëʱ£¬¿ÉÒÔÔÚnativeµÄ³ÌÐòÀͨ¹ýÕâ¸öαcom½Ó¿ÚÀ´ÊµÏÖ´Ë. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ