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

📄 browseinfo.cs

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

    internal class BrowseInfo
    {
        private FileVersionInfo _defalutBrowser;
        private string _ieVersion;
        private static BrowseInfo _instance;

        private BrowseInfo()
        {
            try
            {
                string fileName = string.Empty;
                fileName = ParseString((string) Registry.ClassesRoot.OpenSubKey(@"HTTP\shell\open\command", false).GetValue(string.Empty, string.Empty));
                this._defalutBrowser = FileVersionInfo.GetVersionInfo(fileName);
            }
            catch
            {
                this._defalutBrowser = null;
            }
            try
            {
                this._ieVersion = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Internet Explorer", false).GetValue("Version", string.Empty).ToString();
            }
            catch
            {
                this._ieVersion = string.Empty;
            }
        }

        private static string ParseString(string value)
        {
            if (value.Substring(0, 1) == "\"")
            {
                int index = value.IndexOf("\"", 1);
                return value.Substring(1, index - 1);
            }
            return value.Split(new char[] { ' ' })[0];
        }

        public string DefaultBrowse
        {
            get
            {
                try
                {
                    return this._defalutBrowser.ProductName;
                }
                catch
                {
                    return string.Empty;
                }
            }
        }

        public string FileVersion
        {
            get
            {
                try
                {
                    return this._defalutBrowser.FileVersion;
                }
                catch
                {
                    return string.Empty;
                }
            }
        }

        public string IEVersion
        {
            get
            {
                return this._ieVersion;
            }
        }

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

        public string ProductVersion
        {
            get
            {
                try
                {
                    return this._defalutBrowser.ProductVersion;
                }
                catch
                {
                    return string.Empty;
                }
            }
        }
    }
}

⌨️ 快捷键说明

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