日期:2014-05-20  浏览次数:20411 次

asp.net 操作 iis 建虚拟目录 报“未知名称”错误。
try
{
 
                                dirroot   =   new   DirectoryEntry( "IIS://localhost/W3SVC/1/ROOT ");  
DirectoryEntry     newVirDir     =     dirroot.Children.Add( "Webtest ", "IIsWebVirtualDir ");    
newVirDir.Invoke( "AppCreate ",true);    
newVirDir.CommitChanges();    
dirroot.CommitChanges();  
}
catch(Exception     abc)
{
this.Response.Write(abc);
}


abc   报“未知名称错误”   请问这是什么原因?

------解决方案--------------------
权限问题?