由于switch...case用的不是很熟练,今天上班时不记的怎么用。不过,给我5分钟的时间我就想出switch...case怎么写了。说实话今天做技术支持的人就在我面前,我刚写了头switch,就不知道switch...case怎么用了,随后改用if..else写了。被他一了一句“以后不准用if...else,要用swith...case”希望我以后铭记这次的教训。
void Change(string dd)
{
switch (dd)
{
case "1":
txtText.Value = "1111";
break;
case "s":
txtText.Value = "2222";
break;
default:
txtText.Value = "333";
break;
}
}