How to read a user environment variable in C#?

后端 未结 4 2030
北荒
北荒 2021-02-12 12:56

How can I read a user specific environment variable? I know how to get a system wide one, like

Environment.GetEnvironmentVariable(\"SOMETHING\");
4条回答
  •  深忆病人
    2021-02-12 13:30

    Use second overload of GetEnvironmentVariable which let's you specify EnvironmentVariableTarget.

提交回复
热议问题