我想像这样加载图像:
void info(string channel)
{
//Something like that
channelPic.Image = Properties.Resources.+channel
}
因为我不想做
void info(string channel)
{
switch(channel)
{
case "chan1":
channelPic.Image = Properties.Resources.chan1;
break;
case "chan2":
channelPic.Image = Properties.Resources.chan2;
break;
}
}
这样的事情可能吗?