来源:www.cncfan.com | 2006-4-4 | (有1985人读过)
程序代码:
'===================================================== '函数介绍:列出当前服务器WEB站点信息 '本函数使用ADSI,需要Administrators组用户权限 '函数名称:ListWebSite (Computer,Num) '用法:ListWebSite (计算机名称,显示站点数量) '例:显示127.0.0.1计算机上1000个站点信息 'ListWebSite "127.0.0.1","1000" '==================================================== Function ListWebSite(Computer,Num) On Error Resume Next Set SiteObj = GetObject("IIS://"&Computer&"/w3svc/"&i) for i=0 to Num Err.Clear if Err.Number=0 then response.write "<p><b>以下显示为计算机:"&Computer&"上所有站点信息</b></p>" ShowWebSite = SiteObj.Get("ServerBindings") '获得站点IP地址:端口:主机头 Info=split(ShowWebSite(0),":") response.write "站点编号:"&i&"<br>" response.write "站点IP地址:"&Info(0)&"<br>" response.write "站点端口:"&Info(1)&"<br>" response.write "站点主机头:"&Info(2)&"<br><br>" end if next set SiteOjb=nothing End Function
|