兔八哥极品软件园    运行: 2754天 | 文章:583 篇 | 评论:3 条 | 碎语:1条

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);
            }


Powered by 兔八哥极品软件 苏ICP备12049267号 sitemap