简体   繁体   中英

Set environmental variable in VS12 C#

I want to apply the following fix: click me but I don't find how or where to set this. all I found is something with the command, but when I enter this in cmd it doesn't work..

Isn't there a simple file where I could edit this variable? Or a way to do it in the GUI?

To programmatically change an Environment variable from within your application, you can use one of the following three commands:

Setting the environment variable for only the current process:

Environment.SetEnvironmentVariable("<VarName>", "<VarValue>", EnvironmentVariableTarget.Process);

Setting the environment variable for the current user:

Environment.SetEnvironmentVariable("<VarName>", "<VarValue>", EnvironmentVariableTarget.User);

Setting the environment variable for the entire system:

Environment.SetEnvironmentVariable("<VarName>", "<VarValue>", EnvironmentVariableTarget.Machine);

Additional information on Environment.SetEnvironmentVariable() with examples.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM