<IIsWebServer Location ="/LM/W3SVC/1080967266"
LogFileDirectory="E:\Vhost\WebRoot\pinfdc\LogFiles"
LogType="1"
MaxBandwidth="1048576"
MaxConnections="100"
ServerAutoStart="TRUE"
ServerBindings=":80:www.pinfdc.com
:80:pinfdc.com
:80:www.fdchn.cn
:80:pinfdc.vhost1.hytele.com"
ServerComment="pinfdc"
ServerSize="1"
>
</IIsWebServer>
把其中ServerBindings=":80:和:80:pinfdc.vhost1.hytele.com"之间的URL提出来,www.pinfdc.com pinfdc.com www.fdchn.cn
LogFileDirectory="E:\Vhost\WebRoot\pinfdc\LogFiles"
LogType="1"
MaxBandwidth="1048576"
MaxConnections="100"
ServerAutoStart="TRUE"
ServerBindings=":80:www.pinfdc.com
:80:pinfdc.com
:80:www.fdchn.cn
:80:pinfdc.vhost1.hytele.com"
ServerComment="pinfdc"
ServerSize="1"
>
</IIsWebServer>
把其中ServerBindings=":80:和:80:pinfdc.vhost1.hytele.com"之间的URL提出来,www.pinfdc.com pinfdc.com www.fdchn.cn
foreach (vhttp vh in ahttp)
{
MatchCollection mc = Regex.Matches(IISstr, @"ServerBindings=\""([^""]*):80:" + vh.hshttp.Trim(), RegexOptions.IgnoreCase); if (mc.Count>0)
{
foreach (Match m in mc)
{
Regex reg = new Regex(@":80:");
string[] wad = reg.Split(m.Groups[1].Value);
string strc = vh.name; foreach (string st in wad)
{
strc += " " + st.Trim();
} }
}
else
{
richTextBox1.Text += vh.name+"\n";
}
}
你的也应该是对的,没试了