ASP.NET虚拟主机安全漏洞解决方案[4]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 sukey00 的 blog

 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
}

本文关键:ASP.NET虚拟主机安全漏洞解决方案
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top