I have a Winforms app written in C#, which is also used on Linux machines, and it runs fine using Wine. I only have a problem with getting the path to the Desktop when running on Linux (Wine). In the code I'm using Environment.GetFolderPath(Environment.SpecialFolder.Desktop) to get the Desktop path. It returns 'C:\Users\user\Desktop' (both on Windows and Linux), but when running under Wine, this folder is a part of a simulated Windows environment within Wine, and not the actual Linux desktop, which is '/home/user/Desktop'. My questions are:
How to detect from my app if it's running on Windows or Linux (Wine)?
If the app is running on Linux (Wine), how can I get the actual Linux desktop path, instead of 'C:\Users\user\Desktop'?
Thanks
I tried searching for "c# get desktop path on linux", but nothing useful comes up.
I have a Winforms app written in C#, which is also used on Linux machines, and it runs fine using Wine. I only have a problem with getting the path to the Desktop when running on Linux (Wine). In the code I'm using Environment.GetFolderPath(Environment.SpecialFolder.Desktop) to get the Desktop path. It returns 'C:\Users\user\Desktop' (both on Windows and Linux), but when running under Wine, this folder is a part of a simulated Windows environment within Wine, and not the actual Linux desktop, which is '/home/user/Desktop'. My questions are: [list] [*]How to detect from my app if it's running on Windows or Linux (Wine)? [*]If the app is running on Linux (Wine), how can I get the actual Linux desktop path, instead of 'C:\Users\user\Desktop'? [/list] Thanks
I tried searching for "c# get desktop path on linux", but nothing useful comes up.
I have a Winforms app written in c#, which needs to save a file on the desktop. I'm using Environment.GetFolderPath(Environment.SpecialFolder.Desktop) to get the path to the Desktop, and it runs fine. I need the app to also run on Linux (using...
I have a Winforms app written in c#, which needs to save a file on the desktop. I'm using Environment.GetFolderPath(Environment.SpecialFolder.Desktop) to get the path to the Desktop, and it runs fine. I need the app to also run on Linux (using...
Это мой код, мне нужен мой сервис, чтобы создать ярлык для приложения на рабочем столе пользователя, если ярлык не существует. когда я отлаживаю свое приложение в Visual Studio, ярлык помещается на мой рабочий стол, но когда я запускаю службу в...