C#ÈëÃÅ
±äÁ¿¡¢³£Á¿¼°±í´ïʽ±äÁ¿ºÍ³£Á¿±äÁ¿(¾²Ì¬¡¢·Ç¾²Ì¬¡¢Êý×éÔªËØ¡¢Öµ²ÎÊý¡¢ÒýÓòÎÊý¡¢Êä³ö²ÎÊý¡¢¾Ö²¿±äÁ¿)¾²Ì¬(static) Èç public static int x; Ò»µ©¾²Ì¬±äÁ¿ËùÊôµÄÀà±»×°ÔØ£¬Ö±µ½°üº¬¸ÃÀàµÄ³ÌÐòÔËÐнáÊøÊ±ËüÒ»Ö±´æÔÚ¡£·Ç¾²Ì¬£º²»´øÓÐstaticÐÞÊηûÉùÃ÷µÄ±äÁ¿³ÆÎªÊµÀý±äÁ¿£¬Èçint a ;³£Á¿(attributes constnt-modifiers CONST type contant-declarators)ÆäÖУ¬ÐÞÊηûconstant-modifier ¿ÉÒÔÊÇ£ºnew,public,protected,internal,privatetype±ØÐëÊÇÒÔÏÂÖ®Ò»:sbyte,byte,short,ushort,int,uint,long,ulong,char,float,double,decimal,bool,string,ö¾Ù(enum),ÒýÓÃÀàÐÍ(reference-type);contant-declarators±íʾ³£Á¿µÄÃû×Ö¡¡¡¡È磺public const double x=1.0;+ ÔËËã·û¼È¿É×÷ΪһԪÔËËã·ûÒ²¿É×÷Ϊ¶þ½øÖÆÔËËã·û¡£+expr1 or expr1+expr2Console.Writeline(+5) //Return 5Console.Writeline(5+5) //Return 10Console.Writeline(5+.5) //Return 5.5Console.Writeline(“5”+“5”) //Return 55Console.Writeline(5.0+“5”) //Return 55¡¡¡¡×Ô¶¯½«DOUBLEת»»³ÉSTRING- ÔËËã·û¼È¿É×÷ΪһԪÔËËã·ûÒ²¿É×÷Ϊ¶þ½øÖÆÔËËã·û¡£-expr1 or expr1-expr2int a=5Console.Writeline(-a); //return -5Console.Writeline(a-1); //return 4* ³Ë·¨ÔËËã·û (*) ¼ÆËã²Ù×÷ÊýµÄ³Ë»ý¡£ËùÓÐÊýÖµÀàÐͶ¼¾ßÓÐÔ¤¶¨ÒåµÄ³Ë·¨ÔËËã·û¡£expr1*expr2Using Systemclass Test{ Public static void main() { Console.Writeline(5*2); //return 10 Console.Writeline(-.5*.2) //return -0.1 Console.Writeline(-.5m*.2m) //return -0.10 СÊýÀàÐÍ }}/ ³ý·¨ÔËËã·û (/) Óõڶþ¸ö²Ù×÷Êý³ýµÚÒ»¸ö²Ù×÷Êý¡£ËùÓÐÊýÖµÀàÐͶ¼¾ßÓÐÔ¤¶¨ÒåµÄ³ý·¨ÔËËã·û¡£expr1/expr2Console.Writeline(-5/2) //return -2Console.Writeline(-5.0/2) //return -2.5% Ä£ÊýÔËËã·û (%) ¼ÆËãµÚ¶þ¸ö²Ù×÷Êý³ýµÚÒ»¸ö²Ù×÷ÊýºóµÄÓàÊý¡£ËùÓÐÊýÖµÀàÐͶ¼¾ßÓÐÔ¤¶¨ÒåµÄÄ£ÊýÔËËã·û¡£expr1%expr2Console.Writeline(5%2) //return 1 intConsole.Writeline(-5%2) //return -1 intConsole.Writeline(5.0%2.2) 
Ïà¹ØÎĵµ£º
1£©XmlÎĵµÊ¾Àý£¨xmlsample.xml£©£º
Code
<?xml version="1.0" encoding="iso-8859-1" ?>
<music>
<song title="Oh,girl">
<artist>The Chi-lites</artist>
<genre>Soul</genre>
&nb ......
C# ÓïÑÔÖеÄÓÐЩ¹¹ÔìÒªÇóij¸öÀàÐÍÖÁÉÙÓëij¸ö³ÉÔ±»òÆäËûÀàÐ;ßÓÐͬÑùµÄ¿É·ÃÎÊÐÔ (at least as accessible as)¡£Èç¹û T µÄ¿É·ÃÎÊÓòÊÇ M ¿É·ÃÎÊÓòµÄ³¬¼¯£¬ÎÒÃǾÍ˵ÀàÐÍ T ÖÁÉÙÓë³ÉÔ±»òÀàÐÍ M ¾ßÓÐͬÑùµÄ¿É·ÃÎÊÐÔ¡£»»ÑÔÖ®£¬Èç¹û T ÔÚ¿É·ÃÎÊ M µÄËùÓÐÉÏÏÂÎÄÖж¼ÊǿɷÃÎʵģ¬Ôò T ÖÁÉÙÓë M ¾ßÓÐͬÑùµÄ¿É·ÃÎÊÐÔ¡£
´æÔÚÏÂÁпɷÃÎÊÐ ......
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;
......
//»ñµÃºº×ÖµÄÇøÎ»Âë
¡¡¡¡byte[] array = new byte[2];
¡¡¡¡array = System.Text.Encoding.Default.GetBytes("°¡");
int i1 = (short)(array[0] - ''\0'');
¡¡¡¡int i2 = (short)(array[1] - ''\0'');
//unicode½âÂ뷽ʽϵĺº×ÖÂë
¡¡¡¡array = System.Text.Encoding.Unicode.GetBytes("°¡");
¡¡¡¡i1 = (short)(arra ......
c#ÖÐдһ¸ö¶àÏß³ÌÓ¦ÓÃÊǷdz£¼òµ¥µÄ£¬±¾Õ½«½éÉÜÈçºÎÔÚc#ÖÖ¿ª·¢¶àÏ̳߳ÌÐò¡£ÔÚ.netÖÐÏß³ÌÊÇÓÉSystem.Threading Ãû×Ö¿Õ¼äËù¶¨ÒåµÄ¡£ËùÒÔÄã±ØÐë°üº¬Õâ¸öÃû×ֿռ䡣
using System.Threading;
¿ªÊ¼Ò»¸öÏß³Ì
System.Threading Ãû×Ö¿Õ¼äµÄÏß³ÌÀàÃèÊöÁËÒ»¸öÏ̶߳ÔÏó£¬Í¨¹ýʹÓÃÀà¶ÔÏó£¬Äã¿ÉÒÔ´´½¨¡¢É¾³ý¡¢Í£Ö¹¼°»Ö¸´Ò»¸öÏ̡߳£ ......