C 實現獲取IIS站點及虛擬目錄資訊的方法

2021-08-04 11:36:37 字數 1135 閱讀 9440

這篇文章主要介紹了c#實現獲取iis站點及虛擬目錄資訊的方法,可實現獲取iis站點資訊及物理路徑等功能,具有一定參考借鑑價值,需要的朋友可以參考下

using system; 

using system.directoryservices; 

using system.collections.generic; 

using system.text; 

", entry.name); 

console.writeline("path: "

, iisworker.getwebsitephysicalpath(entry)); 

console.writeline("serverbindings: "

, entry.properties[

"serverbindings"

].value); 

console.writeline(); 

directoryentry virentry = new

directoryentry(entry.path + 

"/root"

); foreach (directoryentry entryvirtual in

virentry.children) 

", entryvirtual.schemaclassname); 

console.writeline("name: "

, entryvirtual.name); 

console.writeline("path: "

, entryvirtual.properties[

"path"

].value); 

console.writeline(); 

} } 

intid = convert.toint32(entry.name); 

if(id >= siteid)  } 

} } 

} public

class

iisworker 

else } 

} return

physicalpath; 

} } 

}

希望本文所述對大家的c#程式設計有所幫助。

IIS虛擬目錄作用

虛擬目錄對應到url的名稱 如 http zhidao.baidu.com question 中question就是乙個虛擬目錄 很多時候,上傳的檔案多了,架設伺服器當初設定的主目錄所在盤空間往往就不夠了,怎麼辦?這就需要設定虛擬目錄。虛擬目錄就是將其他目錄以對映的方式虛擬到該ftp伺服器的主目錄下...

IIS站點 虛擬目錄中訪問共享目錄 UNC

unc是 universal naming convention 的簡稱,也叫通用命名規範 通用命名約定。網路 範指區域網 上資源的完整位置名稱。格式為 servername sharename 其中 servername 是伺服器名,sharename 是共享資源的名稱。目錄或檔案的 unc 名稱...

C 本地iis建立虛擬目錄

using system using system.collections.generic using system.text using system.directoryservices 賀清華 namespace create public static string virdirscheman...