Using environment variable in a file path

后端 未结 1 776
余生分开走
余生分开走 2020-12-08 12:30

I\'ve got an environment variable set that points to a specific folder (call it MYFOLDER for example). When typing in %MYFOLDER%\\SubFolder into windows explore

相关标签:
1条回答
  • 2020-12-08 13:08

    Expand it first:

    string path = Environment.ExpandEnvironmentVariables(value);
    

    http://msdn.microsoft.com/en-us/library/system.environment.expandenvironmentvariables.aspx

    0 讨论(0)
提交回复
热议问题