private int inttype;
public string StrType
{
get
{
switch (inttype)
{
case 0: return "特级";
case 1: return "一级";
case 2: return "二级";
case 3: return "三级";
case 4: return "四级";
case 5: return "五级";
default: return "普通";
}
}
}
或者如下
[C#] 纯文本查看复制代码
private int sex;
public string StrSex
{
get
{
switch (sex)
{
case 0: return "女";
case 1: return "男";
default: return "男";
}
}
}