Esempio n. 1
0
        public static string MetodBilgisi(MySistem tableName, string methodName)
        {
            var mos = new ManagementObjectSearcher("Select * from Win32_" + tableName);

            foreach (var mo in mos.Get())
            {
                try
                {
                    return(mo[methodName].ToString());
                }
                catch
                {
                    return("");
                }
            }
            return("");
        }
Esempio n. 2
0
        public static List <string> GetSistemBilgileri(MySistem ms)
        {
            var s = new List <string>();

            try
            {
                var mc = new ManagementClass("Win32_" + ms);
                foreach (var pt in from ManagementBaseObject item in mc.GetInstances() select item.Properties)
                {
                    s.AddRange(from PropertyData item2 in pt where item2.Value != null select item2.Name + " - " + item2.Value.ToString());
                }
                return(s);
            }
            catch
            {
                return(s);
            }
        }