????????????????C#
???????????? ???????[ 2015/7/1 14:46:04 ] ????????C# ??????????
?????????仨??????????????????????????????(??????C#??)?????????????????????????????????????Щ???????????????????????????????????????????棬??????????????????????????????????.NET??????????????????Щ??·??
????1 ?????????
????CLR?й???????????????????????????????????????????????????????檔??????ζ?????????????е???ù???????????????????????????????????磬?????????????????????????????????Щ?????????????????????????????????????????3???????????????????????????????????????????????????Щ????????t???????????Щ?????
????????????????????????????????????????Try..Catch???????????????finally?н????????????????????????????????????????
????2 ??????????
????FileStream fs = File.Open(…);
????Try{…} Finally{ fs.Close;}
????????????????????????У???????е?finally???棬??????UI?????????????Abort()??????????п???fs.Close???????е???????????????finally???????????????fs???????Close???
?????????????£?finally???????????У?????????????Thread.Abort????????ThreadAbortException???????????????????????Abort??
???????????????????????????????????(?????????Thread.Abort())?????????????????????????????????????????????
???????????????????????????????????????????????????????Cancel?????
????3 ??????????
???????????????ж?????????????????int???????????????????????null??????????????????????????????????????????????????????????????
?????????????????£???????????TryParse???????÷????????Parse?????????????????
???????????Convert????????????????????????????漰??????????????л?????????????????????????
????4 ?????????????
?????????????????У????漰?????????????????StringBuilder???????String?????????????????????????string????????????????????????????????????????????String?????κ??????????縳???”+”???????????????д???????μ?????????????ζ???????????????μ??????
????5 const?????????μ?????
??????????????????dll?е?const????????????????
????????????dll?е?const??????????±??????????dll?????const?????????г????????????????????????????dl?е??????
??????????????readonly????const?????????????????????±??????const??????????????readonly?????????????
????6 C#?????????????
????????????????dll?????????????X86?????????????????????????X86(????????????Any CPU)??????64λ???????????С?
????7 ??????????
???????????????????????????????????????????????????????????????????????к?????????????????????????UI????
?????????????????????в?????UI????е??????????????????????“?????????????????????????????”????????????????????????????????飬??????????????????????????????????????л???????е???????
????8 ?????????????????
????try
????{
????//do something
????}
????catch(Exception ex)
????{
????throw;
????}
?????????д????throw???????throw ex??????????stacktrace???????λ?????????????λ?á?
??????
???·???
??????????????????
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