Posted by: jwalin on: December 13, 2007
you can get the IIS Version programically by using following way. If you are using Windows 2003 or Windows Vista then you can get by using
DirectoryEntry dirRoot = new DirectoryEntry(IISRoot);
DirectoryEntry child = dirRoot.Children.Find(“Info”, “IIsWebInfo”);
foreach (PropertyValueCollection c in child.Properties)
{
if (string.Compare(c.PropertyName, “MajorIIsVersionNumber”, StringComparison.CurrentCultureIgnoreCase) == 0)
{
return Convert.ToInt16(c.Value, CultureInfo.InvariantCulture);
}
}
But if you are using windows XP then It is difficult [...]