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

C#ÖÐstring×÷ΪÒýÓÃÀàÐÍÓëÀàµÄÇø±ðµÄÒ»¸öÎÊÌâ

RT¡£ÏÈÌù´úÂë
C# code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Value_Ref_test1
{
class Program
{
static void Main(string[] args)
{
point a = new point (10,10) ;
point b = a;
a.x = 20;
Console.WriteLine(a.x);
Console.WriteLine(b.x);
}
}
public class point
{
public int x;
public int y;
public point(int Xvalue,int Yvalue)
{
this.x = Xvalue;
this.y = Yvalue;
}
}
}
ÕâÑùµÄ»°×îºó»áÊä³ö
20
20
ÒòΪa£¬bÁ½¸ö±äÁ¿ÒýÏòÁËͬһ¸ö¶ÑÄÚ´æÉϵĶÔÏó¡£
µ«ÊÇͬÑùstringÒ²ÊÇÒýÓÃÀàÐÍ¡£
C# code
string a ="123";
string b = a;
b = "321";
ÔÙÊä³öµÄ»°¾ÍÊÇb£¬a¾ÍÊÇ321,123¡£
¿¼ÂÇ¿ÉÄÜÊÇÓÉÓÚstringÔÚ±àÒëʱ±»ÄÚÖã¬ÓÚÊÇÓÖÊÔÁËһϷÇÄÚÖõÄstring£¨¸Ð¾õÕâÑùдstring²»»á±»ÄÚÖᣣ©
C# code
Random a = new Random();
string b = a.Next().ToString();
string c = b;
Console.WriteLine("b={0}",b);
Console.WriteLine("c={0}", c);
c = a.Next().ToString();
Console.WriteLine("b={0}", b);
Console.WriteLine("c={0}", c);
OK£¬×îºó½á¹ûb£¬c»¹ÊÇÊä³öµÄ²»Í¬½á¹û¡£¡£¡£
µÈ´ý¶®µÃÈ˽â´ðΪʲô¡£¡£¡£


Ïà¹ØÎĵµ£º

C# ²Ù×÷MySQLÊý¾Ý¿âµÄ¼òµ¥Àý×Ó

ʾÀýÑÝʾÁËÓÃC#²Ù×÷MySQLµÄ·½·¨£¬ÌṩÁËÈý¸ö¿ÉÖØÓõÄÀàMySqlDBUtil,MySqlPageUtil,Page¡£
±¾Ê¾ÀýÓÉ C#²Ù×÷AccessÊý¾Ý¿âµÄ¼òµ¥Àý×Ó£¨http://www.albertsong.com/read-56.html£©Ð޸ĶøÀ´¡£
1.Ê×ÏÈÏÂÔØMySQLÊý¾Ý¿âµÄ.NETÇý¶¯
http://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-5.0.8.1-noinstall.zip/ ......

c# ´ÓXML¶ÁÊý¾Ý

C#
 DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("~/Config/User_yhlx_Jb.xml"));
DataView dv = ds.Tables[0].DefaultView;
//dv.RowFilter = "State=0";
this.DropDownList1.DataSource = dv;
this.DropDownList1.DataTextField = "text";
this ......

c# XMLÐòÁл¯Óë·´ÐòÁл¯

Ô­ÏÈÒ»Ö±ÓÃBinaryFormatterÀ´ÐòÁл¯Í¦ºÃ£¬¿ÉÊÇ×î½ü·¢ÏÖÔÚWinCEÏÂÊÇûÓа취½øÐÐBinaryFormatter²Ù×÷£¬ºÜ²»Ë¬£¬Ö»ÄܸijÉÁËBinaryWriterºÍBinaryReaderÀ´¶Áд£¬Í»È»Ïëµ½Äܲ»ÄÜÓÃXMLÀ´ÐòÁл¯£¿ÓÚÊÇÔÚÍøÉϲéÁËЩ×ÊÁϱãдÁËЩʵ¼ùÐÔ´úÂ룬×öЩ¼Ç¼£¬±ÜÃâÒÔºóÍü¼Ç¡£
ÐòÁл¯¶ÔÏó
    public class People
  ......

C#СTip£ºXml²Ù×÷¼òÃ÷ÊÖ²á 3

3£©¶ÁÈ¡¡¢²éÕÒ
µ±ÄãÊÖÍ·ÓÐÒ»¸öxmlÎļþºó£¬¿ÉÒÔʹÓÃXmlDocument.Load()·½·¨½«Æä¼ÓÔؽøÀ´ÒԱ㴦Àí£¬ËùÒÔ“¶ÁÈ¡”ûÓÐʲô¿É˵µÄ¡£¶ø“²éÕÒ”²Ù×÷ÍùÍùÉæ¼°XPath£¬ÕâÀïÖ»ÊÇÎÒÈÏΪµÄ±È½Ï³£Óõ½µÄ²éÕÒ²Ù×÷£¬XPathÕâÍæÒâʵÔÚÊǺÜÇ¿´óºÜ±©Á¦¡£
 
»ØÍ·¿´Ê¾ÀýÎĵµxmlsample.xml£¬ÎÒÃÇ¿ÉÄÜÓöµ½ÕâÑùµÄÐèÇó£ ......

c# Ö§³ÖXMLÐòÁл¯µÄ·ºÐÍ Dictionary

/// <summary>
/// Ö§³ÖXMLÐòÁл¯µÄ·ºÐÍ Dictionary
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TValue"></typeparam>
[XmlRoot("SerializableDictionary")]
public class SerializableDictionary<TKey, TValue& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ