IIS API - 创建虚拟目录? [英] IIS API - Create virtual directories?

查看:173
本文介绍了IIS API - 创建虚拟目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是为了寻找相关文件。一个例子是没有必要的,但将是AP preciated。

Just looking for the relevant documentation. An example is not necessary, but would be appreciated.

我们有一个情况下,我们不得不手动创建虚拟目录的100年代,而且好像自动化,这将是一个很好的方式,使目前的流程更加高效。

We have a situation where we are having to create 100s of virtual directories manually, and it seems like automating this would be a good way to make the process more efficient for now.

也许明年我们可以返工服务器的环境,让更多的东西理智,如URL重写(不幸的是这似乎并没有在Web应用程序的当前周期可行)。是不是很伟大继承废话code?

Perhaps next year we can rework the server environment to allow something more sane, such as URL rewriting (unfortunately this does not seem feasible in the current cycle of the web application). Isn't it great to inherit crap code?

〜威廉·赖利陆

推荐答案

显然,你也可以通过PowerShell脚本做到这一点:

Evidently you can also do this via PowerShell scripting:

$objIIS = new-object System.DirectoryServices.DirectoryEntry("IIS://localhost/W3SVC/1/Root")
$children = $objIIS.psbase.children
$vDir = $children.add("NewFolder",$objIIS.psbase.SchemaClassName)
$vDir.psbase.CommitChanges()
$vDir.Path = "C:\Documents and Settings\blah\Desktop\new"
$vDir.defaultdoc = "Default.htm"
$vDir.psbase.CommitChanges()

下面的文档: - 使用IIS编程管理

这篇关于IIS API - 创建虚拟目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆