I am writing a console application for SharePoint. Mostly, I will be using it for both MOSS and SharePoint 2010. I have two separate functions - one for MOSS and other for SharePoint 2010. In my Main method, I want to detect the version of sharepoint and call the funtion accordingly.
Please let me know the best way to do that.