arraylist list = new arraylist();
string tmpstr;
string entpath = string.format("iis://{0}/w3svc", hostname);
directoryentry ent = getdirectoryentry(entpath);
foreach(directoryentry child in ent.children)
{
if(child.schemaclassname == "iiswebserver")
{
tmpstr = child.name.tostring();
list.add(convert.toint32(tmpstr));
}
}
list.sort();
int i = 1;
foreach(int j in list)
{
if(i == j)
{
i++;
}
}
return i.tostring();
}
#endregion
}
#region 新网站信息结构体
public struct newwebsiteinfo
{
private string hostip; // the hosts ip address
private string portnum; // the new web sites port.generally is "80"
private string descofwebsite; // 网站表示。一般为网站的网站名。例如"www.dns.com.cn"
private string commentofwebsite;// 网站注释。一般也为网站的网站名。
private string webpath; // 网站的主目录。例如"e:\tmp"
public newwebsiteinfo(string hostip, string portnum, string descofwebsite, string commentofwebsite, string webpath)
{
this.hostip = hostip;
this.portnum = portnum;
this.descofwebsite = descofwebsite;
this.commentofwebsite = commentofwebsite;
this.webpath = webpath;
}
public string bindstring
{
get
{
return string.format("{0}:{1}:{2}", hostip, portnum, descofwebsite);
}
}
public string commentofwebsite
{
get
{
return commentofwebsite;
}
}
public string webpath
{
get
{
return webpath;
}
}
}
#endregion
}