The BEST way to use the AppData directory, IS to use Environment.ExpandEnvironmentVariable
method.
Reasons:
Examples:
string path;
path = @"%AppData%\stuff";
path = @"%aPpdAtA%\HelloWorld";
path = @"%progRAMfiLES%\Adobe;%appdata%\FileZilla"; // collection of paths
path = Environment.ExpandEnvironmentVariables(path);
Console.WriteLine(path);
%ALLUSERSPROFILE% C:\ProgramData
%APPDATA% C:\Users\Username\AppData\Roaming
%COMMONPROGRAMFILES% C:\Program Files\Common Files
%COMMONPROGRAMFILES(x86)% C:\Program Files (x86)\Common Files
%COMSPEC% C:\Windows\System32\cmd.exe
%HOMEDRIVE% C:
%HOMEPATH% C:\Users\Username
%LOCALAPPDATA% C:\Users\Username\AppData\Local
%PROGRAMDATA% C:\ProgramData
%PROGRAMFILES% C:\Program Files
%PROGRAMFILES(X86)% C:\Program Files (x86) (only in 64-bit version)
%PUBLIC% C:\Users\Public
%SystemDrive% C:
%SystemRoot% C:\Windows
%TEMP% and %TMP% C:\Users\Username\AppData\Local\Temp
%USERPROFILE% C:\Users\Username
%WINDIR% C:\Windows