???????@?????????
????1??????????????????????
????C#?淶???У??????????????????class??bool?????????????????????????????@????????????
??????????????????@??????????Щ????????????????????????á?
???????磺
????string @class="hello";  //???????
????string class="hello";   //????
????2??@??????????????????
???????磺
????string str=@"hello
????world
????!"; //????д???????
????3?????????????
??????????????г?????????????“”??????????????????????????????????д??“\”???????????????????д??????????????????????@?????
????????:
????string path="d:\Data\web\ss.txt";//???д??
????string path=@"d:Datawebss.txt";//???@????
????????using???÷?
????1??using ???
??????????????????????磺using System;
????2??????????????????????
????using?????????????????????????????????????????????????????????????????????ж?ó???????????ò?????
????????????в??????κε??ò???????????????????using????????????????????
?????????????????????????????????????????????????????а??????????????????
????????SharpMap.Geometries.Point??System.Drawing.Point???????????????????????????趨???????????
????using SGPoint = SharpMap.Geometries.Point;
????using SDPoint = System.Drawing.Point;
???????????????????????????????????????????????????????????????using???????????
??????Ч?????????????????????????????????????
????3??using???
????using???????????????????????????????????????using??????????????????IDisposable?????
????IDisposable???????Dispose???????÷??????????????????
???????磺
????using??TextReader reader=new StreamReader(filename)??
????{
????string line;
????whil((line=read.ReadLine())!=null)
????{
????Console.WriteLine(line);
????}
????}
??????????????????
????{
????TextReader reader=new StreamReader(filename);
????try
????{
????string line;
????while((line=read.ReadLine())!=null)
????{
????Console.WriteLine(line);
????}
????}
????finally
????{
????if(reader!=null)
????{
????(IDisposible)reader.Dispose();
????}
????}
????}
????4????ù???
????1??using????????????IDisposable??????????????????IDisposable???????????using?????????????????
????2??using???????????????????й???????????????????й????????????try-finnaly??????
???????????using??????????????Bug?????using???????????????????????using???????????
????3??using????????????????????????????Щ?????????????????????磺
????using(Pen p1 = new Pen(Brushes.Black)?? p2 = new Pen(Brushes.Blue))
????{
????//todo
????}
????4????????????????????????????????????IDisposable????????磺
????using (IDisposable font = new Font("Verdana"?? 12)?? pen = new Pen(Brushes.Black))
????{
????float size = (font as Font).Size;
????Brush brush = (pen as Pen).Brush;
????}