Hello,
Welcome to Microsoft Q&A!
We can simply use System.Environment.GetFolderPath() to access the file path on each platform .
Sample code
public string GetPath()
{
var path= Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "count.txt");
if (backingFile == null || !File.Exists(backingFile))
{
return ;
}
return path;
}
Check the exact directories path on each platform
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.