App: C#, .NET4, Windows 7
When an app starts up, it gets a copy of the current environment variables and they stay constant for the life of that app. I want to know how to get the actual current environment variables, allowing me to react to changes.
Do I need to go to the registry? I've pondered spawning a cmd.exe and dumping the output of set, but I'd prefer something less hacky.
Thanks