Is there a way to set environment variables for an application so that whenever the process runs there wouldn't be no need to reset them. In fact, I'm writing a .NET applications' profiler and I need to set environment variables for a list of processes (I get the list from a config file). In other words, I previously know the processes to profile and I need to set the environment variables for them before they run
To work around this problem, use the interop services to set the environment variables. You can set an environment variable by using the Microsoft Platform Software Development Kit (SDK) SetEnvironmentVariable function.
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.