http://www.xxx.com/13582235/是可以的,建立虚拟目录用下面的方法
protected void CrearteVirPath(string webName,string webPath)
{
if(webname=="")
return;
try
{
DirectoryEntry dirRoot0 = new DirectoryEntry("IIS://localhost/w3svc/1/root");
DirectoryEntry newVirDir0 = dirRoot0.Children.Find(webName, "IIsWebVirtualDir");
dirRoot0.Children.Remove(newVirDir0);
dirRoot0.CommitChanges();
}
catch
{}
DirectoryEntry dirRoot = new DirectoryEntry("IIS://localhost/w3svc/1/root");
DirectoryEntry newVirDir = dirRoot.Children.Add(webName, "IIsWebVirtualDir");
newVirDir.Invoke("AppCreate", true);
newVirDir.Properties["Path"][0] =webPath;
newVirDir.CommitChanges();
}
protected void CrearteVirPath(string webName,string webPath)
{
if(webname=="")
return;
try
{
DirectoryEntry dirRoot0 = new DirectoryEntry("IIS://localhost/w3svc/1/root");
DirectoryEntry newVirDir0 = dirRoot0.Children.Find(webName, "IIsWebVirtualDir");
dirRoot0.Children.Remove(newVirDir0);
dirRoot0.CommitChanges();
}
catch
{}
DirectoryEntry dirRoot = new DirectoryEntry("IIS://localhost/w3svc/1/root");
DirectoryEntry newVirDir = dirRoot.Children.Add(webName, "IIsWebVirtualDir");
newVirDir.Invoke("AppCreate", true);
newVirDir.Properties["Path"][0] =webPath;
newVirDir.CommitChanges();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货