c# 遍历enum
作者:admin 发布于:2014-9-18 16:46 Thursday 分类:网络转载
public enum BeepType { SimpleBeep = -1, IconAsterisk = 0x00000040, IconExclamation = 0x00000030, IconHand = 0x00000010, IconQuestion = 0x00000020, Ok = 0x00000000, } string[] x = (string[])Enum.GetNames(typeof(Win32Api.BeepType)); int[] y = (int[])Enum.GetValues(typeof(Win32Api.BeepType)); for (int i = 0; i < 100; i++) { MessageBox.Show(i.ToString()); Win32Api.MessageBeep((Win32Api.BeepType)i); }