if (!Enum.IsDefined(typeof(SearchMode), options)) throw new ArgumentException(Properties.Resources.InvalidEnumerationValue, "options"); 如果数据库中存储的值,在程序里用枚举表示,在做parse的时候可以使用这样的方法监测options的值。 相关文章: 2022-12-23 2021-05-21 2022-01-16 2022-12-23 2021-11-04 2021-07-14 2021-10-28 2021-11-02