I've tried this:
var systemPath = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
var complete = Path.Combine(systemPath, extractfilename);
But it results in:
C:\ProgramData\Extract.txt
My expected output is:
C:\User\AppData\Extract.txt
You need to create file in Environment.SpecialFolder.ApplicationData
folder.
There is another way also to get its value, so you can use it also and append the path.
e.g.
string path;
path = @"%AppData%\test";
Environment.ExpandEnvironmentVariables(path);