Click here to Skip to main content
15,888,461 members
Articles / .NET
Alternative
Tip/Trick

A safe way to get the user to check if the .NET framework is installed

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
3 May 2011CPOL 11.8K   4
//Also you can get the path like this because not everyone uses Drive C:\ as I use Drive F:\ string path = Environment.SystemDirectory.Remove(3) + @"Windows\Microsoft.NET\Framework"
//Also you can get the path like this because not everyone uses Drive C:\ as I use Drive F:\
 

C#
string path = Environment.SystemDirectory.Remove(3) + @"Windows\Microsoft.NET\Framework"

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
I do not claim to be wrong! I just rarely ever write.

Comments and Discussions

 
GeneralCheck for .NET using .NET itself? Pin
Anshul R25-May-11 20:37
Anshul R25-May-11 20:37 
Generalreport wrong? it returns the first 3 letters of the drive c:... Pin
charles henington5-May-11 11:05
charles henington5-May-11 11:05 
report wrong? it returns the first 3 letters of the drive c:\, f:\, d:\, etc. etc. Not sure of the file system virtualization will have to look into that but as for privileges Environment.SystemDirectory.Remove(3) simply returns the top directory of the local user if i'm missing something please eloborate??
GeneralRe: check reply Pin
charles henington15-May-11 4:29
charles henington15-May-11 4:29 
GeneralThis has a slight chance to report wrong when under limited ... Pin
Vercas3-May-11 3:14
Vercas3-May-11 3:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.