.Net??????????С????
???????????? ???????[ 2017/6/13 11:22:38 ] ??????????????????? .NET ????
???????@?????????
????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;
????}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11