[Mono-dev] How To know in runtime inside a C# program

Andreas Nahr ClassDevelopment at A-SoftTech.com
Thu Jul 26 16:22:02 EDT 2007


 
Just use
Path.Combine (FirstPart, SecondPart)
It will create the correct path for the system you are running on.

Andreas

-----Ursprüngliche Nachricht-----
Von: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] Im Auftrag von josepascual
Gesendet: Donnerstag, 26. Juli 2007 10:30
An: 'Mono devel list'
Betreff: [Mono-dev] How To know in runtime inside a C# program

Hi Everyone,

I'm doing a program in C# using mono. I want to run it in win32 and linux. I
have a problem with '/' and '\' for directory in win32 and linux.

How Can I know in runtime if I'm in linux (unix) or in Windows to choose '\'
for windows and '/' for linux in path for files?

thank you,

Jose Pascual

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list




More information about the Mono-devel-list mailing list