In my c # wpf application, I want to get a login to enter my documents path. I am using the following code.
string myDocumentPath = System.IO.Path.Combine(Environment.ExpandEnvironmentVariables("%userprofile%"), "Documents");
But when you start the wpf application using "Run as administrator", I got the path to the "Administrator" document using the code above.
Are there any other problems for this problem? Please accept any idea or advice.
source
share