⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 systeminfo.cs

📁 破解的飞信源代码
💻 CS
字号:
namespace Imps.Client.Utils.Information.Software
{
    using Imps.Client.Utils.Win32;
    using Microsoft.Win32;
    using System;
    using System.Globalization;
    using System.Runtime.InteropServices;

    public class SystemInfo
    {
        private static SystemInfo _instance;
        private bool _isAeroEnable;
        private Imps.Client.Utils.Information.Software.Language _langInformation;
        private string[] _netFrameworkCollection;
        private OperatingSystem _osInformation;
        private Imps.Client.Utils.Information.Software.TimeZone _tzInformation;

        private SystemInfo()
        {
            try
            {
                this._osInformation = Environment.OSVersion;
            }
            catch
            {
            }
            try
            {
                TimeZoneInformation lpTimeZoneInformation;
                Imps.Client.Utils.Win32.NativeMethods.GetTimeZoneInformation(out lpTimeZoneInformation);
                this._tzInformation = new Imps.Client.Utils.Information.Software.TimeZone();
                this._tzInformation.Name = lpTimeZoneInformation.standardName;
                this._tzInformation.GMT = lpTimeZoneInformation.bias / -60;
            }
            catch
            {
            }
            try
            {
                this._langInformation = new Imps.Client.Utils.Information.Software.Language();
                this._langInformation.CurrentCulture = CultureInfo.CurrentUICulture;
                this._langInformation.CurrentUICulture = CultureInfo.CurrentUICulture;
                this._langInformation.SystemDefaultLanguage = Imps.Client.Utils.Win32.NativeMethods.GetSystemDefaultLangID();
                this._langInformation.SystemDefaultLC = Imps.Client.Utils.Win32.NativeMethods.GetSystemDefaultLCID();
                this._langInformation.UserDefaultLanguage = Imps.Client.Utils.Win32.NativeMethods.GetUserDefaultLangID();
                this._langInformation.UserDefaultLC = Imps.Client.Utils.Win32.NativeMethods.GetUserDefaultLCID();
                this._langInformation.SystemDefaultUILanguage = Imps.Client.Utils.Win32.NativeMethods.GetSystemDefaultUILanguage();
                this._langInformation.UserDefaultUILanguage = Imps.Client.Utils.Win32.NativeMethods.GetUserDefaultUILanguage();
                if (((this._osInformation != null) && (this._osInformation.Version != null)) && (this._osInformation.Version.Major >= 6))
                {
                    this._langInformation.ThreadUILanguage = Imps.Client.Utils.Win32.NativeMethods.GetThreadUILanguage();
                }
                else
                {
                    this._langInformation.ThreadUILanguage = 0;
                }
            }
            catch
            {
            }
            try
            {
                this._isAeroEnable = false;
                if (((this._osInformation != null) && (this._osInformation.Version != null)) && (this._osInformation.Version.Major >= 6))
                {
                    DwmIsCompositionEnabled(ref this._isAeroEnable);
                }
            }
            catch
            {
            }
            try
            {
                RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\NET Framework Setup\NDP", false);
                if (key != null)
                {
                    this._netFrameworkCollection = new string[key.SubKeyCount];
                    int index = 0;
                    foreach (string text in key.GetSubKeyNames())
                    {
                        this._netFrameworkCollection[index] = text;
                        index++;
                    }
                }
                else
                {
                    this._netFrameworkCollection = null;
                }
            }
            catch
            {
            }
        }

        [DllImport("dwmapi.dll")]
        private static extern int DwmIsCompositionEnabled(ref bool en);

        public static SystemInfo Instance
        {
            get
            {
                if (_instance == null)
                {
                    _instance = new SystemInfo();
                }
                return _instance;
            }
        }

        public bool IsAeroEnable
        {
            get
            {
                return this._isAeroEnable;
            }
            set
            {
            }
        }

        public Imps.Client.Utils.Information.Software.Language Language
        {
            get
            {
                return this._langInformation;
            }
        }

        public string[] NetFrameworks
        {
            get
            {
                return this._netFrameworkCollection;
            }
            set
            {
            }
        }

        public string Platform
        {
            get
            {
                try
                {
                    return this._osInformation.Platform.ToString();
                }
                catch
                {
                    return string.Empty;
                }
            }
        }

        public string ServicePack
        {
            get
            {
                try
                {
                    return this._osInformation.get_ServicePack();
                }
                catch
                {
                    return string.Empty;
                }
            }
        }

        public Imps.Client.Utils.Information.Software.TimeZone TimeZone
        {
            get
            {
                return this._tzInformation;
            }
        }

        public System.Version Version
        {
            get
            {
                try
                {
                    return this._osInformation.Version;
                }
                catch
                {
                    return null;
                }
            }
        }

        public string VersionString
        {
            get
            {
                try
                {
                    return this._osInformation.get_VersionString();
                }
                catch
                {
                    return string.Empty;
                }
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -