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

C# ref¹Ø¼ü×ÖµÄÀí½â

ÎÞÒâÖп´µ½ref¹Ø¼ü×Ö£¬Ö»¼ÇµÃÒ»¿ªÊ¼Ñ§Ï°C#µÄʱºò£¬ÓкܶණÎ÷¶¼Ìø¹ýÈ¥ÁË¡£ ½ñÌì¸Õ¿´¼ûÕâ¸ö¹Ø¼ü×ÖµÄʱºò£¬»¹Õæ²»ÖªµÀËüÓÐʲôÌرðµÄµØ·½¡£googleÁËһϣ¬ÕÒµ½Ò»Æª½âÊÍµÄ±È½Ï ºÃµÄÎÄÕ¡£ÈçÏ£º C# ÖеıäÁ¿ C# ÖеÄÊý¾ÝÓÐÁ½ÖÖÀàÐÍ£ºÒýÓÃÀàÐÍ£¨reference types£©ºÍÖµÀàÐÍ£¨value types£©¡£ ¼òµ¥ÀàÐÍ£¨°üÀ¨int, long, doubleµÈ£©ºÍ½á¹¹£¨structs£©¶¼ÊÇÖµÀàÐÍ£¬¶øÆäËûµÄÀ඼ÊÇÒýÓÃÀàÐÍ¡£ ¼òµ¥ÀàÐÍÔÚ´«ÖµµÄʱºò»á×ö¸´ÖƲÙ×÷£¬¶øÒýÓÃÀàÐÍÖ»ÊÇ´«µÝÒýÓ㬾ÍÏñ C++ ÖеÄÖ¸ÕëÒ»Ñù¡£×¢Òâ structs ÔÚ C# ºÍ C++ ÖеÄÇø±ð¡£ÔÚ C++ ÖУ¬ structs ºÍÀà»ù±¾Ïàͬ£¨except that the default inheritance and default access are public rather than private£©¡£ ¶øÔÚ C# ÖУ¬structs ºÍÀàÓкܴóµÄÇø±ð¡£ÆäÖÐ×î´óµÄÇø±ð£¨ÎÒ¸öÈ˾õµÃ£¬Í¬Ê±Ò²ÊÇÈÝÒ׺öÂÔµÄÒ»¸öµØ·½£©¿ÉÄܾÍÊÇËüÊÇÖµÀàÐÍ£¬¶ø²»ÊÇÒýÓÃÀàÐÍ¡£ÒÀ¾ÝÍøÉϵÄһЩÎÄÕ½éÉÜ£¬ÒªÁ˽â C# ¶ÔÄÚ´æµÄ´¦Àí£¬Ê×ÏÈÒªÁ˽â C# ÖеıäÁ¿£¬ÒÔ¼°±äÁ¿µÄÖµÊÇʲô¡£ÔÚ C# ÖУ¬Ò»¸ö±äÁ¿½ö½öÓÃÓÚÁ¬½ÓÒ»¸öÃû³Æ£¨Õâ¸öÃû³Æµ±È»¾ÍÊDZäÁ¿ÃûÁË£¬ÎÒÃÇÔÚ´úÂëÖÐÓõ½µÄ£©ºÍһС¿éÄÚ´æ¡£Ò»¸ö±äÁ¿ÓÐËüµÄÖµ£¬Ò²¾ÍÊÇÕâС¿éÄÚ´æÖд洢µÄÖµ¡£ÖÁÓÚÕâС¿éÄÚ´æµÄ´óС£¬ÒÔ¼°ÈçºÎ½âÊÍÆäÖд洢µÄÊý¾Ý£¬ÔòÊǺͱäÁ¿µÄÀàÐÍ£¨ÖµÀàÐͺÍÒýÓÃÀàÐÍ£©Ïà¹ØµÄ£»ÕâÒ²¾ÍÊÇÖµÀàÐͺÍÒýÓÃÀàÐ͵ÄÇø±ðËùÔÚ¡£ Ò»¸öÒýÓÃÀàÐ͵ıäÁ¿µÄÖµÓÀÔ¶ÊÇ null »òÕßÒ»¸öÒýÓá£Èç¹ûÊÇÒýÓã¬ÔòËüÒ»¶¨»áÖ¸ÏòÒ»¸öÏà¶ÔÓ¦µÄ¶ÔÏóʵÀý¡£±ÈÈ磺һ¸öÉêÃ÷Ϊ Stream s µÄ±äÁ¿Ò»¶¨»áÊÇ null »òÕßÖ¸ÏòÒ»¸ö Stream ÀàµÄʵÀý£¨µ±È»Ò²¿ÉÄÜÊÇ FileStream, MemoryStream µÈ×ÓÀàµÄʵÀý£©¡£¶øÕâ¸ö±äÁ¿µÄ´óСÔòÓÀÔ¶ÊÇÒ»¸öÒýÓÃËùÐèµÄ´óС£¬ºÍÆäÖ¸ÏòʵÀýµÄ´óСÊÇûÓйØϵµÄ¡£ÔÚ 32 λϵͳÉÏ£¬ÒýÓõĴóСÊÇ 4 ¸ö×Ö½Ú¡£ ¶øÖµÀàÐÍÔò²»Í¬£¡Ò»¸öÖµÀàÐͱäÁ¿µÄÖµ£¨Ëù¶ÔÓ¦ÄÚ´æ¿éÖд洢µÄÊý¾Ý£©ÔòÓÀÔ¶ÊÇÆä¶ÔӦʵÀýµÄÖµ¡£±ÈÈ磬ÎÒÃǶ¨ÒåÁËÒ»¸ö struct£º 1 2 3 4 5 6 public struct MyStruct { public int a; public int b; } MyStruct m1 = new MyStruct(); ÔÚÕâÀ±äÁ¿ m1 µÄÖµÔòÊÇÁ½¸öÕûÊý£¬¶ø²»ÊÇÒ»¸öÖ¸ÏòÁ½¸öÕûÊýµÄÒýÓá£ÆäÄÚ´æÖеĴ洢µÄÊý¾Ý´óСҲ¾ÍÊÇ 8 ¸ö×Ö½Ú£¬¶ø²»ÊÇÒýÓÃËùÐèµÄ 4 ¸ö×Ö½ÚÁË¡£ ½²µ½ÕâÀ´ó¼ÒÒ²¾Í»áÃ÷°×ΪʲôֵÀàÐÍÊÇ°´Öµ´«µÝ£¨copyÕû¸ö¶ÔÏóÖеÄÊý¾Ý£¬¶ÔжÔÏóÊý¾ÝµÄÐÞ¸ÄÊDz»»áÓ°Ïìµ½Ô­¶ÔÏóµÄ£©£¬¶øÒýÓÃÀàÐÍÊÇ°´ÒýÓô«µÝ£¨½ö½ö copy µÄÊÇÒýÓÃ--ÔÝʱ¿ÉÒÔ°ÑËüµ±×÷ÄÚ´æµØÖ·°É£©ÁË£¡¶ø²»½ö½öÊÇ¿´ËüÃǸ÷×ÔµÄÃû³Æ£


Ïà¹ØÎĵµ£º

C# ͨ¹ýado.net ·ÃÎÊoracle

1.°²×°ODP£¨oracle data provider£©
2.È»ºóÔÚÏîÄ¿ÖÐÒýÓà Oracle.DataAccess³ÌÐò¼¯
3.½Ó×Å
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
4.È»ºó±àд³ÌÐòºÍado.net·½Î»sqlserver ²î±ð²»´óÁË£¬¾ÍÊÇÀûÓÃÏÂÃæµÄ¶ÔÏó½øÐбà³Ì£¬µ±È»£¬ÒòΪoracleºÍsqlserverÓкܶàµØ·½²»Ò»Ñù£¬ËùÒÔϸ½Ú´æÔںܴó²îÒì¡£
O ......

[±Ê¼Ç]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ºÅ