C# does not support static local variables (variables that are declared in method scope).
public static class MyStaticClass : MyClass // error CS0713: Static classes must derive from object.
{
static MyStaticClass()
{
Console.WriteLine("MyStaticClass constructor");
}
public static void Test() { Console.WriteLine("MyStaticClass:Test"); }
}
public class Derived : MyStaticClass { } //'Derived': cannot derive from static class 'MyStaticClass'static, readonly, const,布布扣,bubuko.com
原文地址:http://blog.csdn.net/chuwachen/article/details/37693277