麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 網站 > IIS > 正文

C#列表所有IIS站點以及相關站點屬性

2024-08-29 03:13:56
字體:
來源:轉載
供稿:網友
中國最大的web開發資源網站及技術社區,

using system;
using system.drawing;
using system.collections;
using system.componentmodel;
using system.windows.forms;
using system.windows.forms.design;
using system.directoryservices;
using system.reflection;
using system.text.regularexpressions;

int totalservercount=0;  
   
   directoryentry rootfolder = new directoryentry("iis://localhost/w3svc");
   //totalservercount=rootfolder.children.schemafilter.count;
   
   foreach (directoryentry child in rootfolder.children)
   {          
    if (child.schemaclassname == "iiswebserver")
    {      
     totalservercount+=1;        
    }
   }
   //循環獲取所有站點詳細屬性寫入數組中
   string [] arrayserverid = new string[totalservercount];//站點標識符
   string [] arrayserverip = new string[totalservercount];//站點主機頭 
   string [] arrayserverport = new string[totalservercount];//站點主機頭 
   string [] arrayserverheader = new string[totalservercount];//站點主機頭
   string [] arrayserverpath = new string[totalservercount];//站點主機頭 
   string [] arrayservercomment = new string[totalservercount];//站點主機頭

   string [] arrayserverbinds = new string[totalservercount];//站點主機頭

   
   string currentserverbindings;//綁定主機頭ip端口字符串
   char[] a=":".tochararray();
   string [] currentbingdings =new string[2]; 

   int i=0;
   foreach (directoryentry child in rootfolder.children)
   {          
    if (child.schemaclassname == "iiswebserver")
    {       
     arrayserverid.setvalue(child.name.tostring(),i);
     arrayservercomment.setvalue(child.properties["servercomment"].value.tostring(),i);

     currentserverbindings=child.properties["serverbindings"].value.tostring();
     
     currentbingdings=currentserverbindings.split(a);

     arrayserverip.setvalue(currentbingdings[0],i);
     arrayserverport.setvalue(currentbingdings[1],i);
     arrayserverheader.setvalue(currentbingdings[2],i);

     
     foreach (directoryentry rootchild in child.children)
     {
      if((rootchild.schemaclassname == "iiswebvirtualdir")&&(rootchild.name.tostring()=="root"))
      { 
       if(rootchild.properties["path"].value==null)
       {
        arrayserverpath.setvalue("",i);
       }
       else
       {
        arrayserverpath.setvalue(rootchild.properties["path"].value.tostring(),i);
       }
      }
     }
    
     i+=1;
    }
   }


   //寫入到datagrid中去
   //循環從數組中讀取數據
   for(i=0;i<totalservercount;i++)
   {
    
    listview1.items.add((i+1).tostring());   
    listview1.items[i].subitems.add(arrayserverid.getvalue(i).tostring());
    listview1.items[i].subitems.add(arrayservercomment.getvalue(i).tostring());
    listview1.items[i].subitems.add(arrayserverip.getvalue(i).tostring());
    listview1.items[i].subitems.add(arrayserverport.getvalue(i).tostring());
    listview1.items[i].subitems.add(arrayserverheader.getvalue(i).tostring());
    listview1.items[i].subitems.add(arrayserverpath.getvalue(i).tostring());
    
  
   } 


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 99riav国产在线观看 | 女教师~淫辱の动漫在线 | 中国女警察一级毛片视频 | 宅男噜噜噜66国产免费观看 | 看免费的毛片 | 九九视频在线观看黄 | 黄色小视频在线免费看 | 黄色免费入口 | 久草在线精品观看 | 性高湖久久久久久久久aaaaa | 4399一级成人毛片 | 国产午夜精品一区二区三区免费 | 久久国产免费 | 涩涩99| 91麻豆蜜桃一区二区三区 | 欧美五月婷婷 | 二区三区四区 | 免费国产不卡午夜福在线 | 国产成人精品无人区一区 | 久久福利国产 | 中国嫩模一级毛片 | 99亚洲伊人久久精品影院红桃 | 久久国产免费 | 一级α片免费看刺激高潮视频 | 久久蜜桃香蕉精品一区二区三区 | 爱性久久久久久久 | 亚洲成人在线视频网站 | 日韩视频一区二区在线观看 | 久久成人午夜视频 | 日韩在线播放第一页 | 国产精品久久久久久久久久大牛 | 日韩欧美精品电影 | 黄色片在线观看网站 | 国产一区二区三区在线观看视频 | 91在线看黄 | 日本在线视频免费 | 久久另类视频 | 免费观看视频在线 | 国产精品久久久久久久模特 | 性欧美xxxx免费岛国不卡电影 | 91精品国产777在线观看 |