-2

I was going over forums yesterday as my issue is that i need my application to detect what operating system it is using and depending on the operating system, the app does a different function.

The best information i found was the Path.PathSeperator. Can anyone confirm if it is correct and tell me how to use it to detect which operating system is being used?

Thank You Very Much! :)

A.Akubat
  • 13
  • 2

1 Answers1

0
Environment.OSVersion 

Property will help ypu to get the Operating System. Yes you can change some code lines, but to change all codes is not a good idea.

if(Environment.OSVersion.VersionString.Contains("Windows"))
{
   //
}
else
{

}
Suren Srapyan
  • 66,568
  • 14
  • 114
  • 112
  • How do i include that in an if function to say if it is windows say hello, but if it is a mono box say bye @Suren Srapyan – A.Akubat Jun 16 '16 at 09:05