The official way to detect .NET 3.0 is described here
http://msdn.microsoft.com/en-us/library/aa480198.aspx
Flawed, because it requires the caller to have registry access permissions.
MSDN also mentions a technique for detecting .NET 3.5 by checking the User Agent string:
http://msdn.microsoft.com/en-us/library/bb909885.aspx
I think Microsoft should have done a better job than this.