문제

I am currently trying to use the following to access a computer's local AppData folder:

Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);

This returns something along the lines of C:\\Users\\[USERNAME]\\AppData\\Roaming. What I want is to get the default AppData folder, as opposed to any specific user's folder.

I can hard code this C:\Users\Default\AppData\Local, but I'd feel more comfortable if there was a function that provided what I'm looking for.

Is there such a function, and if so, what is it?

도움이 되었습니까?

해결책

I believe SpecialFolder.CommonApplicationData will get what you need.

From the MSDN documentation:

The directory that serves as a common repository for application-specific data that is used by all users.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top