Two alternate possibilities:
One is conceptual. Consider why you are asking the user. Is it because you have a program or website that requires a specific version? If so, you are expected to distribute the proper redist package with your application.
Also conceptually, instead of making the user jump through hoops, why not write a native application that presents the information? I mean, you probably are planning on installing software on the users machine anyway, why not have a program that can do this?
http://support.microsoft.com/kb/318785[
^]
Finally, if you just want a list of installed versions have the user execute the following at the command prompt:
reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP" /v Version /s
Charles Oppermann is a 25-year veteran of software design. He is the original author of JAWS, the popular screen reader for people with visual impairments, and spent over a decade at Microsoft working on accessibility and user experience in the Windows, Internet Explorer and speech product groups.
Charles was a founding representative to the W3C and Web Accessibility Initiative (WAI), and the author of two technical books published by Microsoft Press. He has also worked at Cisco Systems, Amazon.com, and is currently direct test automation efforts at Malwarebytes.