62,242
社区成员




//配置类A和B
public class A
{
private static readonly string key = "9527"; //或丢在静态构造函数中
public static string Key
{ get { return key; } }
}
public class B
{
public const string Key = "9527";
}
/////////////////////////////
public void test()
{
string _const = A.Key;
string _readonly = B.Key;
}