Good,
I have the following code:
private void AspNet35()
{
String sWebSite = "W3SVC/1";
DirectoryEntry site = new DirectoryEntry("IIS://localhost/" + sWebSite + @"/Root");
try
{
PropertyValueCollection vals = site.Properties["ScriptMaps"];
foreach (string val in vals)
{
if (val.StartsWith(".aspx"))
{
string version = val.Substring(val.IndexOf("Framework") + 10, 9);
if (version == "3.5")
{
MessageBox.Show(String.Format("ASP.Net Version on virtual server is {0}", version));
}
}
}
}
catch
{
}
}
The idea was to check if IIS has ASP.NET 3.5 installed. Or at least check wanted the installed versions.
How can I do this?
Thank you