Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个图形生成 Web 服务,它从数据库中获取一组对应标签的参数并将它们绘制到图像上。我有什么简单的方法来计算StringFormatFlags枚举的值。理想情况下,我想使用单个 int 字段,但到目前为止我看不到这样做的方法。
如果我理解正确,您可以将枚举值转换为 int。例如,
foreach(var sff in Enum.GetValues(typeof(StringFormatFlags))) { Debug.WriteLine((int)sff); }