怎樣定義列舉里面專案是什么型別? 如下,參考時不管做int或short,都要強制轉換一下。 能否直接定義成int或short?
public enum UniDI0 : int
{
安全光柵 = 0,
收板氣缸上磁感應器 = 1,
收板真空負壓表 = 2,
}
//或者寫成
public enum UniDI0 : short
{
安全光柵 = 0,
收板氣缸上磁感應器 = 1,
收板真空負壓表 = 2,
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/269627.html
標籤:C#
