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

130µÀc#ÃæÊÔÌâ


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


Ïà¹ØÎĵµ£º

asp.net(c#) ·µ»ØÉÏÒ»Ò³

Õª³­Ç°±²ÃǵÄ
ÆäʵҪʵÏÖÕâ¸ö¹¦ÄÜÖ÷Òª»¹ÊÇÒªÓõ½javascript
·½·¨Ò»£º
ÔÚasp.netµÄaspxÀïÃæµÄÔ´´úÂëÖÐ
<input type="button onclick="javascript:window.history.go(-1);"value="·µ»ØÉÏÒ»Ò³">
dzÎö£ºÕâ¸öÊÇÓÃÁËHTML¿Ø¼þ£¬Í¨¹ýÒ»¸öonclickµÄʼþ£¬µ÷ÓÃÁËjavascriptÖеÄÒ»¸ö·½·¨¾Í¿ÉÒÔÁË¡£Õâ¸öÊÇ×î¼òµ¥µÄÁË£¬Ò²Í¬Ñù ......

C#ʵÏÖAccessµ¼Èëµ¼³öExcel

Ò»¡¢Access´ÓExcelÖе¼ÈëÊý¾Ý
1.Óõ½µÄExcel±íµÄ¸ñʽ¼°ÄÚÈÝ
 
ʵÏÖ
 OleDbConnection con = new OleDbConnection();
try
{
OpenFileDialog openFile = new OpenFileDialog();//´ò¿ªÎļþ¶Ô»°¿ò¡£
openFile.Filter = ("Excel Îļþ(*.xls)|*.xls") ......

C# ίÍеÄÃîÎÄ¡¾×ª¡¿

ίÍкÍʼþÔÚ .Net FrameworkÖеÄÓ¦Ó÷dz£¹ã·º£¬È»¶ø£¬½ÏºÃµØÀí½âίÍкÍʼþ¶ÔºÜ¶à½Ó´¥C#ʱ¼ä²»³¤µÄÈËÀ´Ëµ²¢²»ÈÝÒס£ËüÃǾÍÏñÊÇÒ»µÀ¼÷¶ù£¬¹ýÁËÕâ¸ö¼÷µÄÈË£¬¾õµÃÕæÊÇÌ«ÈÝÒ×ÁË£¬¶øûÓйýÈ¥µÄÈËÿ´Î¼ûµ½Î¯ÍкÍʼþ¾Í¾õµÃÐÄÀï±ð£¨bi裩µÃ»Å£¬»ìÉí²»×ÔÔÚ¡£±¾ÎÄÖУ¬ÎÒ½«Í¨¹ýÁ½¸ö·¶ÀýÓÉdzÈëÉîµØ½²ÊöʲôÊÇίÍС¢ÎªÊ²Ã´ÒªÊ¹Ó ......

c# ³ÌÐòÖ»ÔËÐÐÒ»´ÎµÄ´¦Àí·½·¨

·½·¨Ò»£º±éÀúÕýÔÚÓÐÏàͬÃû×ÖÔËÐеÄÀý³Ì
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace DHPSS.COM
{
/// <summary>
/// c#³ÌÐòÖ»ÔËÐÐÒ»´Î£¬C#Àý³ÌÖ»ÔËÐÐÒ»´Î
/// http://blog.csdn.net/nnsw ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ