C#操作IIS方法集合

2019-12-26 13:27:16王冬梅
  • foreach (DirectoryEntry getchild in getentity.Children)  { 
  • if (getchild.SchemaClassName.Equals("IIsWebVirtualDir"))  { 
  • //找到指定的虚拟目录.  foreach (DirectoryEntry getsite in getchild.Children) 
  • {  if (getsite.Name.Equals(appname)) 
  • {  //【测试成功通过】 
  • getsite.Properties["AppPoolId"].Value = poolName;  getsite.CommitChanges(); 
  • }  } 
  • }  } 
  • }  } 
  • }   
  •   /// <summary> 
  • /// 判断object对象是否为数组  /// </summary> 
  • public static bool IsArray(object o)  { 
  • return o is Array;  } 
  • }  } 

    希望本文所述对大家的C#程序设计有所帮助。