一.using static
1.C#6 using static新语法,可以简化前缀:
例:
1 using static System.Console; //1.使用using static
2
3 namespace test
4 {
5 internal class Program
6 {
7 private static void Main(string[] args)
8 {
9 WriteLine("test"); //2.省去写Console.只是语法糖而已。 Console.WriteLine("test");
10 }
11 }
12 }
2.只能使用它的静态方法
目前我在单例模式来用Instance,省略类名的前缀,这有点类似使用c++的宏定义来使用实例。
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。