string serverAction="设置";
ServerAction sAction = (ServerAction)Enum.Parse(typeof(ServerAction), serverAction);
if (Enum.IsDefined(typeof(ServerAction), sAction))
{
//ok
}
本文转自94cool博客园博客,原文链接:http://www.cnblogs.com/94cool/archive/2012/12/11/2812548.html,如需转载请自行联系原作者