该站点有多个端口
/// <summary> /// 获取网站绑定的IP,端口,主机头 /// </summary> /// <param name="metabasePath">站点</param> /// <param name="propertyName">属性</param> /// <param name="newValue">值</param> static string[] GetSingleProperty(string metabasePath, string propertyName) { DirectoryEntry path = new DirectoryEntry(metabasePath); PropertyCollection ppC = (PropertyCollection)path.Properties; string[] serverBind = ppC[propertyName][0].ToString().Split(':');//获取网站绑定的IP,端口,主机头 return serverBind; }
我这样只可以获取到http的端口?有没有办法获取到该站点所有端口?