LOGO OA教程 ERP教程 模切知識(shí)交流 PMS教程 CRM教程 開(kāi)發(fā)文檔 其他文檔  
 
網(wǎng)站管理員

C#取得iis站點(diǎn)子站點(diǎn)和應(yīng)用程序池的信息

admin
2018年9月8日 15:46 本文熱度 6191
/// <summary>
/// 獲取當(dāng)前IIS站點(diǎn)列表
/// </summary>
/// <returns></returns>
public static List<IISStationInfo> GetLocalIISStations()
{
    List<IISStationInfo> re = new List<IISStationInfo>();
    string entPath = "IIS://localhost/w3svc";
    DirectoryEntry ent = new DirectoryEntry(entPath);
    foreach (DirectoryEntry child in ent.Children)
    {
        if (child.SchemaClassName == "IIsWebServer")
        {
            IISStationInfo item = new IISStationInfo();
            item.ID = child.Name;
            item.Name = child.Properties["ServerComment"].Value.ToString();
            DirectoryEntry root = new DirectoryEntry(entPath + "/" + item.ID + "/ROOT");
            item.Path = root.Properties["Path"].Value.ToString();
            item.AppList = new List<IISAppInfo>(16);
            foreach (DirectoryEntry app in root.Children)
            {
                if (app.SchemaClassName == "IIsWebVirtualDir")
                {
                    IISAppInfo appitem = new IISAppInfo();
                    appitem.Name = app.Name;
                    appitem.ID = app.NativeGuid;
                    appitem.Path = app.Properties["Path"].Value.ToString();
                    appitem.AppName = app.Properties["AppPoolId"].Value.ToString();
                    item.AppList.Add(appitem);
                }
            }
            re.Add(item);
        }
    }
    return re;
}
/// <summary>
/// IIS站點(diǎn)數(shù)據(jù)封裝
/// </summary>
public class IISStationInfo
{
 /// <summary>
 /// 站點(diǎn)名
 /// </summary>
 public string Name { get; set; }
 /// <summary>
 /// 站點(diǎn)指定路徑
 /// </summary>
 public string Path { get; set; }
 /// <summary>
 /// 站點(diǎn)標(biāo)識(shí)符
 /// </summary>
 public string ID { get; set; }
 /// <summary>
 /// 站點(diǎn)包含的應(yīng)用程序,虛擬路徑等
 /// </summary>
 public List<IISAppInfo> AppList { get; set; }
}
/// <summary>
/// IIS應(yīng)用程序子站點(diǎn)數(shù)據(jù)封裝
/// </summary>
public class IISAppInfo
{
 /// <summary>
 /// 站點(diǎn)
 /// </summary>
 public string Name { get; set; }
 /// <summary>
 /// 站點(diǎn)的制定路徑
 /// </summary>
 public string Path { get; set; }
 /// <summary>
 /// 站點(diǎn)的站點(diǎn)標(biāo)識(shí)符
 /// </summary>
 public string ID { get; set; }
 /// <summary>
 /// 站點(diǎn)的應(yīng)用程序名稱
 /// </summary>
 public string AppName { get; set; }
}

該文章在 2018/9/8 15:46:34 編輯過(guò)
關(guān)鍵字查詢
相關(guān)文章
正在查詢...
點(diǎn)晴ERP是一款針對(duì)中小制造業(yè)的專業(yè)生產(chǎn)管理軟件系統(tǒng),系統(tǒng)成熟度和易用性得到了國(guó)內(nèi)大量中小企業(yè)的青睞。
點(diǎn)晴PMS碼頭管理系統(tǒng)主要針對(duì)港口碼頭集裝箱與散貨日常運(yùn)作、調(diào)度、堆場(chǎng)、車隊(duì)、財(cái)務(wù)費(fèi)用、相關(guān)報(bào)表等業(yè)務(wù)管理,結(jié)合碼頭的業(yè)務(wù)特點(diǎn),圍繞調(diào)度、堆場(chǎng)作業(yè)而開(kāi)發(fā)的。集技術(shù)的先進(jìn)性、管理的有效性于一體,是物流碼頭及其他港口類企業(yè)的高效ERP管理信息系統(tǒng)。
點(diǎn)晴WMS倉(cāng)儲(chǔ)管理系統(tǒng)提供了貨物產(chǎn)品管理,銷售管理,采購(gòu)管理,倉(cāng)儲(chǔ)管理,倉(cāng)庫(kù)管理,保質(zhì)期管理,貨位管理,庫(kù)位管理,生產(chǎn)管理,WMS管理系統(tǒng),標(biāo)簽打印,條形碼,二維碼管理,批號(hào)管理軟件。
點(diǎn)晴免費(fèi)OA是一款軟件和通用服務(wù)都免費(fèi),不限功能、不限時(shí)間、不限用戶的免費(fèi)OA協(xié)同辦公管理系統(tǒng)。
Copyright 2010-2025 ClickSun All Rights Reserved

黄频国产免费高清视频,久久不卡精品中文字幕一区,激情五月天AV电影在线观看,欧美国产韩国日本一区二区
这里只有精品99久久 | 伊人久久综合精品永久图片 | 亚洲aV免费一区二区三区 | 在线现看午夜福利片 | 日本免费a级毛一片没码 | 亚洲国产精品久久久天堂麻豆 |