unity工具相关: 获取当前设备的环境变量

    [MenuItem("MyTest/TestVarValue")]
    public static void TestVarValue()
    {
        IDictionary environment = Environment.GetEnvironmentVariables();
        string allKeyName = "";
        foreach (string environmentKey in environment.Keys)
        {
            allKeyName = allKeyName +"|"+ environmentKey;
        }
        Debug.Log("TestVarValue  allKeyName:"+allKeyName);

  Debug.Log("TestVarValue  LOGNAME:"+ Environment.GetEnvironmentVariable("LOGNAME"));
    }

  

posted @ 2022-04-13 17:59  sun_dust_shadow  阅读(244)  评论(0编辑  收藏  举报