开发者

Prevent Expansion of Environment Variables

I am currently developing an application meant to be an improved environment variables editor for Windows.

I have used both System.Environment.GetEnvironmentVariables() and Registry to get them. However both methods expands the text between %, so instead of getting as instance %systemroot%/system32 I get C:/Windows/system32/ in my program.

Is there a way to prevent th开发者_运维技巧e expansion of these items?


When you are getting environment variables from the registry - you need to use a special flag: RegistryValueOptions.DoNotExpandEnvironmentNames.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜