IIS 7 中查询元数据库的新方法是什么?

发布于 2024-09-16 07:13:40 字数 330 浏览 3 评论 0 原文

在 IIS 6 中,我通常使用代码来查询元数据库,如下所示:

var entry = new DirectoryEntry("IIS://localhost/W3SVC");
foreach (DirectoryEntry site in entry.Children)
{
// Blah
}

现在在 IIS 7 中,只有安装了 IIS 6 兼容性时,此功能才起作用。我真正想做的是使用推荐的 IIS 7 做事方式。

我的问题是这样的。在不需要 IIS 6 兼容模式的情况下,以代码形式从本地或远程计算机上的 IIS 7 元数据库获取信息的“正确”方法是什么?

In IIS 6, I typically used code to query the metabase as in the following:

var entry = new DirectoryEntry("IIS://localhost/W3SVC");
foreach (DirectoryEntry site in entry.Children)
{
// Blah
}

Now in IIS 7, this only functions if IIS 6 compatibility is installed. What I'd really like to do is use the recommended IIS 7 way of doing things.

My question is this. What is the "proper" way to get information from the IIS 7 metabase on a local or remote machine in code without requiring IIS 6 compatibility mode?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温柔戏命师 2024-09-23 07:13:40

新方法是使用 Microsoft.Web.Administration 命名空间:

http://msdn.microsoft.com/en-us/library/microsoft.web.administration(VS.90).aspx

The new way is to use the Microsoft.Web.Administration namespace:

http://msdn.microsoft.com/en-us/library/microsoft.web.administration(VS.90).aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文