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?


They mostly come at night...mostly.

See More: Environment Variables in C#

Report •

September 26, 2005 at 12:48:40

I just used:
public static extern bool SetEnvironmentVariable(string VariableName, string VariableValue);


They mostly come at night...mostly.

Report •

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... :-(

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

Report •

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