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

C#ÖÐrefºÍoutµÄÇø±ð

¿´Á˺ܶà.°´ÕÕ ×Ô¼ºÃ÷°×½âÊÍһϠ.NET RefºÍOut¹Ø¼ü×Ö ¶ÔÓÚÖµÀàÐÍ¡£ Èç¹û²»Ê¹ÓÃref /outÔò´«µÝµÄÖ»ÊÇÕâЩֵµÄCOPY, ʹÓÃÁËRefºÍOutµÄЧ¹û¾Í¼¸ºõºÍCÖÐʹÓÃÁËÖ¸Õë±äÁ¿Ò»Ñù¡£(´«µÝµÄ¾ÍÊÇÔ­Öµ),ËüÄܹ»ÈÃÄãÖ±½Ó¶ÔÔ­Êý½øÐвÙ×÷£¬¶ø²»ÊǶÔÄǸöÔ­ÊýµÄCopy½øÐвÙ×÷ ¶ÔÓÚÒýÓÃÀàÐÍ: Èç¹û²»Ê¹ÓÃref /out,ÒòΪ´«µÝµÄÊÇÒýÓÃÀàÐ͵ĵØÖ·Öµ,Ôò½«´«µÝÒýÓÃÀàÐ͵ĵØÖ·ÖµµÄÒ»¸öCOPY(--Õë¶ÔµØÖ·ÖµµÄ½Ç¶È»¹ÊÇÖµÀàÐÍ´«µÝ),ʵ¼ÊÉϾÍÊÇпªÒ»¸ö²»Í¬µÄÄÚ´æ±äÁ¿À´´æ´¢Õâ¸öµØÖ·ÖµµÄ¿½±´ ¶øÊ¹ÓÃref /out,´«µÝµÄ»¹ÊÇÒýÓÃÀàÐ͵ĵØÖ·Öµ,µ«ÊÇ´«µÝµÄ¾Í²»ÊÇÒ»¸öбäÁ¿À´´æ¿½±´,¶øÊǾÍÊÇ´«Ô­À´µÄÄǸöÓ¦ÓÃÀàÐ͵ĵØÖ·Öµ /////////////////×¢ÒâlistµÄ´¦Àí////////²»ÓùØÐÄ,Òì²½,´úÀíίÍÐÕâЩ;¿ÉÒÔºÍʹÓÃͬ²½·½·¨Ò»ÑùÀí½â£»Ö»ÊÇÕýºÃÓöµ½ÁËÕâ¸öÀý////////////////////////////////////////////////×ÓËùÒÔÄÃÀ´Óã» public delegate string DelegateWithParameters(string param1, int param2, ArrayList list); private void CallFooWithParameters() { // create the paramets to pass to the function string strParam1 = "Param1"; int intValue = 100; ArrayList list = new ArrayList(); list.Add("Item1"); // create the delegate DelegateWithParameters delFoo = new DelegateWithParameters(FooWithParameters); // call FooWithParameters(string param1,int param2, ArrayList list) // ʵ¼ÊÉÏlistµÄÒýÓõØÖ·×÷ΪֵÀàÐÍ´«µÝ,½øÈë·½·¨Ê±,ÓÃÒ»¸öÐÂÄÚ´æ±äÁ¿´æ´¢Õâ¸öÒýÓõĵØÖ· //ËùÒÔÔÚº¯ÊýÄÚ²¿¶à¸ÃÐÂÄÚ´æ±äÁ¿µØÖ·ÐÞ¸Ä.Ö»ÊÇÈøÃÐÂÄÚ´æ±äÁ¿Ö¸ÏòÁËÁíÍâÒ»¸ölist IAsyncResult tag = delFoo.BeginInvoke(strParam1, intValue, list, null, null); // normally control is returned right away, // so you can do other work here... // calling end invoke to get the return value string strResult = delFoo.EndInvoke(tag); // write down the parameters: Trace.WriteLine("param1: " + strParam1); Trace.WriteLine("param2: " + intValue); Trace.WriteLine("ArrayList count: " + list.Count); } private string FooWithParameters(string param1, int param2, ArrayList list) { // lets modify the data! param1 = "Modify Value for param1"; param2 = 200; list = new ArrayList(); //listÊÇ´«½øÀ´µÄÄǸöµØÖ·µÄ¿½±´;ËùÒÔÖ»ÊǰÑÕâ¸öеĿ½±´Ö¸ÏòÁËÒ»¸öеÄnew ArralyList()¶ÔÏó //Ë


Ïà¹ØÎĵµ£º

C# winformÓë flash as µÄ½»»¥Í¨Ñ¶

Ò»¡¢»ù±¾Ô­Àí¼°¹ý³Ì
Flashͨ¹ýExternalInterfaceÀàÓëÈÝÆ÷Ó¦ÓóÌÐò½øÐÐͨÐÅ¡£Îª´Ë£¬ExternalInterfaceÀàÌṩÁ½¸ö¾²Ì¬ÊôÐÔºÍÁ½¸ö¾²Ì¬·½·¨¡£
ExternalInterface.call(“º¯ÊýÃû”£¬[²ÎÊý…])·½·¨Ö´ÐÐÈÝÆ÷Ó¦ÓóÌÐòµÄ´úÂ룬¸Ã·½·¨ÖÁÉÙÐèÒªÒ»¸ö×Ö·û´®²ÎÊýÀ´Ö¸¶¨Òªµ÷Óõĺ¯ÊýÃû£¬ÆäËüÈκβÎÊý½«×÷Ϊ²ÎÊý±»´«µÝ¸ø± ......

C#´¦ÀíXML

ÒÑÖªÓÐÒ»¸öXMLÎļþ£¨bookstore.xml£©ÈçÏ£º
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
  <book genre="fantasy" ISBN="2-3631-4">
    <title>Oberon's Legacy</title>
    <author>Corets, Eva</author>
  &nb ......

c#ÀûÓÃwinapi±éÀú×ÀÃæ¿Ø¼þËã·¨

public enum GUIInfoType
{
     guiText.
     guiTextClass,
     guiTextParent,
     guiTextClassParent,
}
private static int level=0
public static int FindGUILike(ref int hWndArray,int hWndStart,ref string window ......

[±Ê¼Ç]C#ʵÏÖ¶¯Ì¬±àÒë

½ñÌì¿´ÁËÎÒµÄÀÏʦÖÓÉùµÄÊé¡¶Java³ÌÐòÔ±ÉϰàÄǵã¶ùÊ¡·£¬ÆäÖÐÓÐÒ»¶Î¹ØÓÚJavaʵÏÖ¶¯Ì¬±àÒëµÄ´úÂëʹÎÒºÜÊÜÆô·¢£¬¾ö¶¨ÔÚ.NETÖг¢ÊÔһϡ£
ÒýÈëÏÂÁÐÃüÃû¿Õ¼ä£º
using System.CodeDom;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
C#´úÂ룺
     &n ......

C#ÀûÓÃwinapi²¶×½Êó±ê²Ù×÷¿Ø¼þµÄ¾ä±ú

public struct POINTAPI
{
   public int x;
   public int y;
}
public static void GetWindowfromPoint(ref int hwnd,ref StringBuilder winText,ref StringBuilder clsName,ref StringBuilder pText)
{
  int parentHandle=0;
  int maxLen=128;
  POINTAPI pnt = new ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ