_Core/Lang/Plugins/Parser/MachineInfoPlugin.cs

(开头部分) 4KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ComLib.Lang;


namespace ComLib.Lang.Extensions
{

    /* *************************************************************************
    <doc:example>	
    // Machine info plugin provides variable names to get information about the machine
        
    print ( @machine        )
    print ( @domain         )
    print ( @user           )
    print ( @cmdline        )
    
    print ( mac.numprocs    )
    print ( mac.osname      )
    print ( mac.osversion   )
    print ( mac.osspack     )
    
    print ( mac sysdir      )
    print ( mac memory      )
    print ( mac version     )
    print ( mac currentdir  )  
	
	// NOTES:
    // Any of the properties above can be prefixed with either
    // 1. mac.<property>
    // 2. mac <property>
    // 3. @<property>
    
    </doc:example>
    ***************************************************************************/

    /// <summary>
    /// Combinator for handling days of the week.
    /// </summary>
    public class MachineInfoPlugin : ExprPlugin
    {
        private static IDictionary<string, Func<string>> _map;


        static MachineInfoPlugin()
        {
            _map = new Dictionary<string, Func<string>>();
            _map["machine"] = () => Environment.MachineName;
            _map["domain"] = () => Environment.UserDomainName;
            _map["user"] = () => Environment.UserName;
            _map["cmdline"] = () => Environment.CommandLine;
            _map["numprocs"] = () => Environment.ProcessorCount.ToString();
            _map["osname"] = () => Environment.OSVersion.Platform.ToString();
            _map["osversion"] = () => Environment.OSVersion.Version.ToString();
            _map["osspack"] = () => Environment.OSVersion.ServicePack;
            _map["sysdir"] = () => Environment.SystemDirectory;
            _map["memory"] = () => Environment.WorkingSet.ToString();
            _map["version"] = () => Environment.Version.ToString();
后面还有 95 行代码,解锁后查看完整代码

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

AI 解读

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

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