6

I want to create a environment variables using C# and VB.Net code and able to Read,Delete and Set values to the new created variable. help me with code to do this process.

1 Answers1

10

You can use Environment.SetEnvironmentVariable to create, modify or delete environment variable and Environment.GetEnvironmentVariable for retrieve it.

Reference: https://learn.microsoft.com/en-us/dotnet/api/system.environment.setenvironmentvariable?view=netframework-4.7.2 To delete you set it to null.