Little Registry Cleaner/Common Tools/LittleSoftwareStats/OperatingSystem/UnixOperatingSystem.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace LittleSoftwareStats.OperatingSystem
{
    internal class UnixOperatingSystem : OperatingSystem
    {
        public UnixOperatingSystem()
        {
        }

        Hardware.Hardware _hardware;
        public override Hardware.Hardware Hardware
        {
            get
            {
                if (_hardware == null)
                    _hardware = new Hardware.UnixHardware();
                return _hardware;
            }
        }

        public override string Version
        {
            get { return Utils.GetCommandExecutionOutput("uname", "-rs"); }
        }

        public override int ServicePack
        {
            get { return 0; }
        }

        private Version _frameworkVersion;
        public override Version FrameworkVersion
        {
            get
            {
                if (this._frameworkVersion == null)
                {
                    try
                    {
                        Type type = Type.GetType("Mono.Runtime");
                        if (type != null)
                        {
                            MethodInfo invokeGetDisplayName = type.GetMethod("GetDisplayName", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
                            if (invokeGetDisplayName != null)
                            {
                                string displayName = invokeGetDisplayName.Invoke(null, null) as string;
                                this._frameworkVersion = new Version(displayName.Substring(0, displayName.IndexOf(" ")));
                            }
                        }
                    }
                    catch { }

                    if (this._frameworkVersion == null)
                    {
                        // Just use CLR version
后面还有 53 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。