C# 一些小东东
- 在C#中,如果有一个方法我们不想继续使用,需要废弃的时候,可以在该方法前面加上一个[Obsolete]。
- string[] arr={"a","b"}
-
if $(ConfigurationName)==Release copy /y $(TargetPath) E:\Develop\CommonDll
if $(ConfigurationName)==Release copy /y $(TargetDir)LZL.XML E:\Develop\CommonDl - vs 事件命令不要加"",会报错;
-
[Conditional("DEBUG")]
internal static void Log(object obj)
{} - vs发布网站时,报cs0006错误,切换成Release编译一下
- C#交互窗口可以直接运行C#代码,打开方式:视图》其他窗口》C#交互
-
<configSections>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" requirePermission="false" />
</sectionGroup>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
<section name="SingleTagSectionTest" type="System.Configuration.SingleTagSectionHandler" />
<section name="DictionarySectionTest" type="System.Configuration.DictionarySectionHandler" />
<section name="NameValueSectionTest" type="System.Configuration.NameValueSectionHandler" />
</configSections> - volatile :volatile 关键字指示一个字段可以由多个同时执行的线程修改。声明为 volatile 的字段不受编译器优化(假定由单个线程访问)的限制。这样可以确保该字段在任何时间呈现的都是最新的值。