问大家个问题
MSDN中对于Enum.Format方法抛出的InvalidOperationExceptiond的解释是:format 等于“X”,但枚举类型未知。
谁能与个例子么
Enum.Format方法原型:
[ComVisibleAttribute(true)]
public static string Format(
Type enumType,
Object value,
string format
)
MSDN中对于Enum.Format方法抛出的InvalidOperationExceptiond的解释是:format 等于“X”,但枚举类型未知。
谁能与个例子么
Enum.Format方法原型:
[ComVisibleAttribute(true)]
public static string Format(
Type enumType,
Object value,
string format
)
法,该方法接受一个与枚举格式有关的字符串:format 参数可以是"G"或"g"
string s = System.Enum.Format(typeof(enum1), enum1, "G");