Little Registry Cleaner/Common Tools/LittleSoftwareStats/Hardware/MacOSXHardware.cs

(开头部分) 2KB

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

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

namespace LittleSoftwareStats.Hardware
{
    internal class MacOSXHardware : UnixHardware
    {
        public MacOSXHardware()
        {
        }

        public override string CPUName 
        {
            get { 
                try
                {
                    Regex regex = new Regex(@"Processor Name\s*:\\s*(?<processor>[\w\s\d\.]+)");
                    MatchCollection matches = regex.Matches(Utils.SystemProfilerCommandOutput);
                    return matches[0].Groups["processor"].Value;
                }
                catch { }

                return "Generic"; 
            }
        }

        public override int CPUArchitecture
        {
            get
            {
                Regex regex = new Regex(@"hw\.cpu64bit_capable\s*(:|=)\s*(?<capable>\d+)");
                MatchCollection matches = regex.Matches(Utils.SysctlCommandOutput);
                if (matches[0].Groups["cpus"].Value == "1")
                    return 64;
                return 32;
            }
        }

        public override int CPUCores
        {
            get 
            {
                Regex regex = new Regex(@"hw\.availcpu\s*(:|=)\s*(?<cpus>\d+)");
                MatchCollection matches = regex.Matches(Utils.SysctlCommandOutput);
                return int.Parse(matches[0].Groups["cpus"].Value);
            }
        }

        public override string CPUBrand 
        {
            get { return "GenuineIntel"; }
        }

        public override double CPUFrequency 
        {
            get
            {
后面还有 21 行代码,购买后查看完整代码

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

AI 解读 AI

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

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