What is the best way to detect the operating system? My program needs to know it the computer is Windows, Mac, or Linux.

Thanks.