I'm trying to get the "Default Desktop Path"(a "Path" that brings me on the Desktop on "every" Pc).
I'm not good at programmings/english, Sorry. :( But i would love to get an answer. :)
I'm trying to get the "Default Desktop Path"(a "Path" that brings me on the Desktop on "every" Pc).
I'm not good at programmings/english, Sorry. :( But i would love to get an answer. :)
My guess is that you want:
Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)
Since you are looking for a directory path it makes more sense to me to use SpecialFolder.DesktopDirectory
instead of SpecialFolder.Desktop
. But I am of course guessing a little at your exact requirements.
Please refer to the following documentation:
If you want to get the file system path:
Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)
If you want to get the shell namespace folder:
Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
P.S.: If you do not know the difference: What's the difference between SpecialFolder.Desktop and SpecialFolder.DesktopDirectory?
I think you want this:
path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
This returns the path of the Desktop folder. Much more powreful than any manual path building because the user could change this path.