简体   繁体   English

从IIS6-IIS7获取应用程序池版本

[英]get Application pool version from IIS6-IIS7

Hello i want to get framework version from all my application pool (with IIS 6/7). 您好,我想从我所有的应用程序池(使用IIS 6/7)中获取框架版本。 This is how i get application pool name: 这是我获取应用程序池名称的方法:

Dim AppPools As DirectoryEntry = New DirectoryEntry("IIS://localhost/W3SVC/AppPools")Then
     For Each nextEntry As DirectoryEntry In AppPools.Children
            Dim nextAppPoolName As String = nextEntry.Name
            Dim pipelineMode As Integer = CInt(nextApplicationPool.Properties(MANAGED_PIPELINE_MODE).Value)                  
     Next

i can get framework from my web sites but i don't want this. 我可以从我的网站上获取框架,但是我不想要这个。 how i can to do? 我该怎么办?

We use IIS-api for IIS7: 我们将IIS-api用于IIS7:

using (var iisManager = ServerManager.OpenRemote(iisServer))
{
    var site = iisManager.Sites[IisSite];
    var app = site.Applications[0];

    var pool = iisManager.ApplicationPools[app.ApplicationPoolName];
}

Where iisServer is name of your server (localhost), IisSite - name of site on server, app - first (default) apllication of this site and pool - your apllication pool. 其中iisServer是服务器的名称(本地主机), IisSite服务器上的站点名称, app -该站点和pool第一个(默认)应用app -您的应用程序池。

More information about pool api and ServerManager . 有关pool apiServerManager的更多信息。 I hope, you can translate it to VB. 希望您可以将其翻译为VB。

IIS6 has no api and almost has any "good" way to get this information. IIS6没有api,几乎没有任何“好的”方式来获取此信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM