Determine the name of a constant based on the value

后端 未结 7 1036
广开言路
广开言路 2021-01-05 22:07

Is there a way of determining the name of a constant from a given value?

For example, given the following:

public const uint ERR_OK = 0x00000000;

Ho

7条回答
  •  轮回少年
    2021-01-05 22:34

    You may be interested in Enums instead, which can be programmatically converted from name to value and vice versa.

提交回复
热议问题