示例#1
0
        /// <summary>
        /// https://blog.csdn.net/pengze0902/article/details/53366287
        /// ManagementClass
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            WMIShell Shell = new WMIShell()
            {
                Title       = "Windows Management Information",
                InputHeader = "wmi",

                ServicePort = 6103,

                ServiceModeAllowInput = true,
            };

            ConsoleApplication.Run(Shell, args);
        }
示例#2
0
        public void MOList()
        {
            Type type = typeof(Win32APIEnum);

            String[] Names = type.GetEnumNames();

            JArray Keys = new JArray();

            foreach (String Name in Names)
            {
                Keys.Add(new JObject()
                {
                    ["ID"]          = (int)Enum.Parse(type, Name),
                    ["Name"]        = Name,
                    ["Description"] = WMIShell.GetDescription((Win32APIEnum)Enum.Parse(type, Name)),
                });
            }

            WriteLine(new JObject()
            {
                ["Table"] = Keys,
            }, _OutputFormat);
        }