Articles

Environment Variables in C#

September 26, 2005 at 12:27:11
Specs: Windows XP Pro, Mobil CPU 1.60GHz/512MB

I need some help with programmatically setting environment variables using C#.

I can obtain them easily using System.Environment...but how can I write them?

TIA,
Chi


They mostly come at night...mostly.


See More: Environment Variables in C#

Report •


#1
September 26, 2005 at 12:48:40

Nvm,
I just used:
[DllImport("KERNEL32.DLL")]
public static extern bool SetEnvironmentVariable(string VariableName, string VariableValue);


Chi

They mostly come at night...mostly.


Report •

#2
September 27, 2005 at 13:36:36

WHAT?! It was THAT easy?! I was very lazy to do that when I coded in C# so I stopped working on the program... :-(

http://sulfurmidis.com/sulfursoft
http://tsfc.ath.cx
ftp://tsfc.ath.cx
hotline://tsfc.ath.cx

If I connect my microwave to my PC, will I be able to download food?


Report •

#3
September 27, 2005 at 16:22:17

After SetEnvironmentVariable(....) is called, does the result persist after the completion of the calling process?

Thanks, Guy


Report •

Related Solutions


Ask Question