我想知道从哪里System.Globalization.CultureInfo.CurrentCulture读取其值的设置或位置 .
我正在使用Windows 7笔记本电脑,并已将我的系统的区域和日期时间设置更改为美国.
我在下面的web.config设置下使用了我的代码
<globalization culture="en-US" />
Run Code Online (Sandbox Code Playgroud)
谢谢
我在项目中的所有类和命名空间之外声明了以下枚举:
public enum ServerType { Database, Web } // there are more but omitted for brevity
我想用以下内容覆盖该ToString()方法:
public override string ToString(ServerType ServerType)
{
switch (ServerType)
{
case ServerType.Database:
return "Database server";
case ServerType.Web:
return "Web server";
}
// other ones, just use the base method
return ServerType.ToString();
}
Run Code Online (Sandbox Code Playgroud)
但是我收到一个错误 no suitable method found to override
使用我自己的方法转换为字符串时是否可以覆盖枚举?