If you ever wanted to get the version of the SharePoint you are running, you could find it out using the below ways:
Power Shell to the rescue:
If you just wanted to find the version for information purpose you can quickly launch PowerShell and type the below command which will give you the below output:
The Major version gives you the information you need, if its 14 – SharePoint 2010. If its 12 – SharePoint 2007.
If you want to get the SharePoint Version and perform some logic based on that you could use the below code. I have placed the code in a web part. You need to add the Microsoft.SharePoint.Administration; namespace to run this code.
protected override void CreateChildControls()
SPFarm _spFarm = SPFarm.Local;
int version = _spFarm.BuildVersion.Major;
this.Title = “SharePoint 2010″;