楼上荒谬
RmsCode s = (RmsCode)Enum.Parse(typeof(RmsCode), "用车类型");
private void button1_Click(object sender, EventArgs e)
{
string s = "用车类型";
RmsCode rc = (RmsCode)Enum.Parse(typeof(RmsCode), s);
MessageBox.Show(((int)rc).ToString());
}
(int)test;//直接强制转换