开发者

How to translate paths with environment variables (Eg. %temp%)

开发者 https://www.devze.com 2023-04-10 03:31 出处:网络
I am searching for a winapi function to expand paths with environment variables. I have tried GetFullPathName but the result is weird: \"%appdata%\\some开发者_运维问答thing\" becomes \"C:\\<path to

I am searching for a winapi function to expand paths with environment variables. I have tried GetFullPathName but the result is weird: "%appdata%\some开发者_运维问答thing" becomes "C:\<path to directory of exe>\%appdata%\something".

How to do this correctly?


Try ExpandEnvironmentStrings.


Cause I needed it with C#/.NET: Environment.ExpandEnvironmentVariables Method

I hope it'll help somebody.

0

精彩评论

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