⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sol15-3a.vbs

📁 Apress - Managing Enterprise Systems With The Windows Script Host Source Code
💻 VBS
字号:
Const MediumProtection = 2
Dim objService, objWebSite, objVirtDir
'get a reference to the Web service on server Odin
Set objService = GetObject("IIS://odin/W3SVC")

'create a new Web site and assign it the value of 5 as its 'name'
Set objWebSite = objService.create("IIsWebServer", 5)
'assign a friendly comment to appear in the IIS MMC
objWebSite.ServerComment = "New Web site"
objWebSite.SetInfo

'bind the site to an IP address and distinguished name
objWebSite.ServerBindings = Array("192.168.1.40:80:accounting.acme.com")
objWebSite.SetInfo

'create a virtual ROOT directory for the site
Set objVirtDir = objWebSite.create("IIsWebVirtualDir", "ROOT")
objVirtDir.Accessread = True
objVirtDir.Path = "f:\inetpub\newsite" 'set the Web directory
objVirtDir.SetInfo

'create an application for the ROOT directory
objVirtDir.AppCreate MediumProtection
objVirtDir.AppFriendlyName = "Default Application"

objVirtDir.SetInfo

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -