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

C#¡¢ASP.NETÖÐrefºÍoutµÄÇø±ð

ÕâÁ½¸öÊý¾ÝÀàÐÍÊÇÎÒÃÇÔÚѧϰC#ÓïÑԵĹý³ÌÖÐÊý¾Ý±È½ÏÄѵÄÁ½¸öÊý¾ÝÀàÐÍ£¬²»¹ýËûÃǺÜÖØÒª£¬ËùÒÔÓбØÒªÄóöÀ´ËµËµËûÃǵÄʹÓ÷½·¨ºÍ²»Í¬Ö®´¦£¬Ï£Íû¶ÔÄãÓÐËù°ïÖú¡£
ÏÈ×ܵÄÀ´Ëµ£º
ͨ³£ÎÒÃÇÏò·½·¨Öд«µÝµÄÊÇÖµ.·½·¨»ñµÃµÄÊÇÕâЩֵµÄÒ»¸ö¿½±´,È»ºóʹÓÃÕâЩ¿½±´,µ±·½·¨ÔËÐÐÍê±Ïºó,ÕâЩ¿½±´½«±»¶ªÆú,¶øÔ­À´µÄÖµ²»½«Êܵ½Ó°Ïì.´ËÍâÎÒÃÇ»¹ÓÐÆäËûÏò·½·¨´«µÝ²ÎÊýµÄÐÎʽ,ÒýÓÃ(ref)ºÍÊä³ö(out).
ÓÐʱ,ÎÒÃÇÐèÒª¸Ä±äÔ­À´±äÁ¿ÖеÄÖµ,Õâʱ,ÎÒÃÇ¿ÉÒÔÏò·½·¨´«µÝ±äÁ¿µÄÒýÓÃ,¶ø²»ÊDZäÁ¿µÄÖµ.ÒýÓÃÊÇÒ»¸ö±äÁ¿,Ëû¿ÉÒÔ·ÃÎÊÔ­À´±äÁ¿µÄÖµ,ÐÞ¸ÄÒýÓý«ÐÞ¸ÄÔ­À´±äÁ¿µÄÖµ.±äÁ¿µÄÖµ´æ´¢ÔÚÄÚ´æÖÐ,¿ÉÒÔ´´½¨Ò»¸öÒýÓÃ,ËûÖ¸Ïò±äÁ¿ÔÚÄÚ´æÖеÄλÖÃ.µ±ÒýÓñ»ÐÞ¸Äʱ,Ð޸ĵÄÊÇÄÚ´æÖеÄÖµ,Òò´Ë±äÁ¿µÄÖµ¿ÉÒÔ½«±»ÐÞ¸Ä.µ±ÎÒÃǵ÷ÓÃÒ»¸öº¬ÓÐÒýÓòÎÊýµÄ·½·¨Ê±,·½·¨ÖеIJÎÊý½«Ö¸Ïò±»´«µÝ¸ø·½·¨µÄÏàÓ¦±äÁ¿,Òò´Ë,ÎÒÃÇ»áÃ÷°×,Ϊʲôµ±Ð޸IJÎÊý±äÁ¿µÄÐÞ¸ÄÒ²½«µ¼ÖÂÔ­À´±äÁ¿µÄÖµ.
RefÖ¸Ã÷ÁË·½·¨ÖÐʹÓõÄÊÇÒýÓÃÐͲÎÊý£¬ÒýÓÃÐͲÎÊý²»¿ª±ÙеÄÄÚ´æÇøÓò¡£µ±ÀûÓÃÒýÓÃÐͲÎÊýÏò·½·¨´«µÝÐβÎʱ£¬±àÒë³ÌÐò½«°Ñʵ¼ÊÖµÔÚÄÚ´æÖеĵØÖ·´«µÝ¸Ã·½·¨¡£ÒýÓÃÐͲÎÊýͨ³£ÒѾ­³õʼ»¯¡£  
Èç  
int   i=1,j=2;//³õʼ»¯  
Swap(ref   i,ref   j);  
OutÊä³öÐͲÎÊýÒ²²»¿ª±ÙеÄÄÚ´æÇøÓò£¬µ«ÓëÒýÓÃÐͲÎÊý²»Í¬µÄÊÇ£¬µ÷Ó÷½·¨Ö®Ç°ÎÞÐè¶Ô±äÁ¿½øÐгõʼ»¯£¬Êä³öÐͲÎÊýÖ÷ÒªÓÃÓÚ´«µÝ·½·¨·µ»ØµÄÊý¾Ý¡£  
string   name,path;//ûÓгõʼ»¯  
File(out   name,out   path);
Ê×ÏÈÏÈ˵ref:(MSDN)
C# ¹Ø¼ü×Ö | ·½·¨²ÎÊý
·½·¨²ÎÊýÉ쵀 ref ·½·¨²ÎÊý¹Ø¼ü×Öʹ·½·¨ÒýÓô«µÝµ½·½·¨µÄͬһ¸ö±äÁ¿¡£µ±¿ØÖÆ´«µÝ»Øµ÷Ó÷½·¨Ê±£¬ÔÚ·½·¨ÖжԲÎÊýËù×öµÄÈκθü¸Ä¶¼½«·´Ó³ÔڸñäÁ¿ÖС£ÈôҪʹÓà ref ²ÎÊý£¬±ØÐ뽫²ÎÊý×÷Ϊ ref ²ÎÊýÏÔʽ´«µÝµ½·½·¨¡£ref ²ÎÊýµÄÖµ±»´«µÝµ½ ref ²ÎÊý¡£´«µÝµ½ ref ²ÎÊýµÄ²ÎÊý±ØÐë×îÏȳõʼ»¯¡£½«´Ë·½·¨Óë out ²ÎÊýÏà±È£¬ºóÕߵIJÎÊýÔÚ´«µÝµ½ out ²ÎÊý֮ǰ²»±ØÏÔʽ³õʼ»¯¡£
ÊôÐÔ²»ÊDZäÁ¿£¬²»ÄÜ×÷Ϊref ºÍout²ÎÊý´«µÝ¡£
Èç¹ûÁ½ÖÖ·½·¨µÄÉùÃ÷½öÔÚËüÃÇ¶Ô ref µÄʹÓ÷½Ã治ͬ£¬Ôò½«³öÏÖÖØÔØ¡£µ«ÊÇ£¬ÎÞ·¨¶¨Òå½öÔÚ ref ºÍ out ·½Ã治ͬµÄÖØÔØ¡£ÀýÈ磺
//ÒÔÏÂÖØÔØÉùÃ÷ÊÇÓÐЧµÄ£º
class MyClass
{
public void MyMethod(int i) {i = 10;}
public void MyMethod(ref int i) {i = 10;}
}
µ«ÒÔÏÂÖØÔØÉùÃ÷ÊÇÎÞЧ


Ïà¹ØÎĵµ£º

ASP.NET 2.0 Page ¼ÓÔصĹý³Ì

Ö»ÓÐÔÚ¡òPageÖ¸ÁîÖÐÉèÖÃÁË£ºAutoEventWireup="true"£¬·þÎñÆ÷¶ËµÄ±àÒëÆ÷½«°´ÕÕ Page_eventname ·½·¨ÃûµÄÐÎʽ×Ô¶¯µÄ¼ì²éÏàӦʼþ´¦Àí·½·¨£¬×Ô¶¯ÊµÏÖʼþµÄ¶©ÔÄ¡£
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System ......

asp.net¿ª·¢³£Óü¼ÇÉ

1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
´«ËͲÎÊý£º
response.write("<script>window.open
('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="++"')</script>")
½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1.Attributes.Add("o ......

vs ¿ª·¢ asp.net¹ý³ÌÖÐ ÒýÓà jsÎļþ³ö´íµÄ½â¾ö°ì·¨


ÔÚ.netÖÐͨ¹ýÕâÖÖ·½Ê½ÒýÓÃjsÎļþ
<script type="text/javascript" src="setday0.js"></script>
È»ºóÔÚÒ³ÃæÖе÷ÓÃsetday0.jsÎļþÖеķ½·¨ÍùÍù»á³ö´í£¡µ«ÊÇÄãÈç¹û°Ñsetday0.jsÎļþµÄÄÚÈÝÖ±½Ó·Åµ½¸ÃÒ³ÃæÖÐÀ´ÓÖÒ»µãÎÊÌâҲûÓС£Õâ¸öÎÊÌâÀ§»óÁËÎҺܾã¬ÔÚ1.1µÄʱºò¾ÍÓöµ½Á˵±Ê±Ã»°ì·¨¾ÍÔÚÒ³ÃæÖÐÖØдjs´úÂë¡£½ñÌ ......

ASP.NET»·¾³ÏÂÅäÖÃFCKEditor²¢ÉÏ´«Í¼Æ¬¼°ÆäËüÎļþ

±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/lzy_1515/archive/2010/03/22/5405250.aspx
FCKEditorÓÚ2009Äê±»¸üÃûΪÐÂÒ»´úµÄCKEditorºÍCKFinder£¬¼ûhttp://ckeditor.com/¡£Ö»ÊDZ¾À´ÊÇÒ»¸öµÄ²úÆ·£¨FCKEditor£©ÏÖÔÚ±ä³ÉÁËÁ½¸ö£¨CKEditor + CKFinder£©£¬Èç¹ûÒªÉÏ´«Îļþµ½·þÎñÆ÷ÉÏ£¬×îа汾µÄCKEditor + CKFinde ......

asp.net(c#)ÍøÒ³ÌøתÆßÖÖ·½·¨Ð¡½á

asp.net(c#)ÍøÒ³ÌøתÆßÖÖ·½·¨Ð¡½á
·¢²¼Ê±¼ä£º2009-11-25 11:13:03
¡¡¡¡1.Response.Redirect("http://www.yayiba.com",false);
¡¡¡¡Ä¿±êÒ³ÃæºÍÔ­Ò³Ãæ¿ÉÒÔÔÚ2¸ö·þÎñÆ÷ÉÏ£¬¿ÉÊäÈëÍøÖ·»òÏà¶Ô·¾¶¡£ºóÃæµÄboolֵΪÊÇ·ñÍ£Ö¹Ö´Ðе±Ç°Ò³¡£
ÌøתÏòеÄÒ³Ã棬ԭ´°¿Ú±»´úÌæ¡£"
ä¯ÀÀÆ÷ÖеÄURLΪз¾¶¡£
:Response.Redirect·½ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ