ASP.NET ÃæÊÔÌ⠺ϼ¯
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λÊýÊǶàÉÙ£¬ ÓõݹéË㷨ʵÏÖ¡£
´ð£ºpublic class MainClass
{
public static void Main()
{
Console.WriteLine(Foo(30));
}
public static int Foo(int i)
{
if (i <= 0)
return 0;
else if(i > 0 && i <= 2)
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.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.Ã
Ïà¹ØÎĵµ£º
ÔÚ×öWEBϵͳ¿ª·¢Ê±£¬Ã¿Ã¿Óöµ½Ò³Ãæ´«ÖµµÄÎÊÌⶼÊÇÔÚʹÓÃ×î¼òµ¥µÄGET·½Ê½À´´«Öµ£¬Èç¹ûÐÅÏ¢Á¿±È½ÏÉÙ²¢ÇÒÓÖ²»Éæ¼°°²È«ÎÊÌâµÄ»°
»¹¿ÉÒÔÓ¦¸¶Ò»Ï£¬µ«ÊÇ´«µÝ´óÁ¿Êý¾Ý¡¢Ãô¸ÐÊý¾ÝµÄʱºò.....
ÏÂÃæ¾ÍASP.NETÖÐÒ³Ãæ´«Öµ·½Ê½×ö¸ö»ã×Ü£¬ÒÔ±¸²»Ê±Ö»Ðè
1¡¢GET´«Öµ·½Ê½
·¢ËÍÒ³Ã棺
  ......
//Ìæ»»ËùÓÐ
Regex reg = new Regex(@"(?is)</?a\b[^>]*>(?:(?!</?a).)*</a>");
string result = reg.Replace(yourStr, "");
//±£Áôwww.abc.comÁ´½Ó
Regex reg = new Regex(@"(?is)</?a\b.*?href=(['""]?)(?!(?:http://)?www\.abc\.com)[^'""\s>]+\1[^>]*>(?<text>(?:(?!</?a).) ......
ASP.NET 2.0 AjaxÖÐÄܹ»ÔÚ¿Í»§¶ËjsÖкܷ½±ãµØµ÷Ó÷þÎñÆ÷Webservice£¬ÒÔÏÂΪһЩµ÷ÓõÄʾÀý¡£±ÊÕß°²×°µÄASP.NET 2.0 AJAX
°æ±¾ÎªAJAX November CTP¡£
Èý¸öʾÀý·Ö±ðΪ£º
1 ´ø²ÎÊýµÄWS·½·¨
2 ²»´ø²ÎÊýµÄWS·½·¨
3 ²ÎÊýÀàÐÍΪDataTableµÄWS·½·¨
Ò»¡¢WebMethod
×¢ÒâÒªµã£º
1 WebMethodÀàÐèÒªÌí¼ÓÃüÃû¿Õ¼ä Microsoft.Web. ......
ÒÔÏÂÊǵ¼³öµÄ·½·¨£º
public static void ToExcel(System.Web.UI.Control ctl)
{
//HttpContext.Current.Response.Charset ="GB2312";
HttpContext.Current.Response.Charset = "G ......
ÔÚ.netÖÐͨ¹ýÕâÖÖ·½Ê½ÒýÓÃjsÎļþ
<script type="text/javascript" src="setday0.js"></script>
È»ºóÔÚÒ³ÃæÖе÷ÓÃsetday0.jsÎļþÖеķ½·¨ÍùÍù»á³ö´í£¡µ«ÊÇÄãÈç¹û°Ñsetday0.jsÎļþµÄÄÚÈÝÖ±½Ó·Åµ½¸ÃÒ³ÃæÖÐÀ´ÓÖÒ»µãÎÊÌâҲûÓС£Õâ¸öÎÊÌâÀ§»óÁËÎҺܾã¬ÔÚ1.1µÄʱºò¾ÍÓöµ½Á˵±Ê±Ã»°ì·¨¾ÍÔÚÒ³ÃæÖÐÖØдjs´úÂë¡£½ñÌ ......