Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
From a thread over an internal alias
today.. "urn:schemas-microsoft-com:office:office" />
Some have noticed that in V1 we give
you access the user’s environment variables… We are fixing it in Whidbey where
you can get the user or machine
Environment.GetEnvironmentVariable("TEMP",EnvironmentVariableTarget.Machine)
Notice you can do this in V1
with:
using (RegistryKey environmentKey =
Registry.LocalMachine.OpenSubKey(@"System\CurrentControlSet\Control\Session
Manager\Environment", false)) {
string value = environmentKey.GetValue(variable) as
string;
return value;
}
Useful?
Comments
- Anonymous
December 10, 2003
Anything that reduces the amount of code and hides operating system specific details without sacrificing functionality is a good thing. Most people would not have known how to retrieve that data anyway, so that makes it even better. - Anonymous
December 11, 2003
Yes, it is useful. In addition, taking the target as an argument makes it clear to the developer that there is more than one set of environment variables he should consider. It will help devs write less bugs.