读比较简单,用System.Environment.GetEnvironmentVariable(string)就可以.
写,.Net 要用P/Invoke SetEnvironmentVariable来完成。具体的代码,看这个例子:
http://www.dotnet247.com/247reference/msgs/26/133281.aspx