包括建立FTP站点或目录;
以及建立一个NT用户或WIN2000用户。
---------------
用脚本也可以,请各位兄弟帮忙!
10 个解决方案
#1
建议用VB.NET
#2
But I don't know VB.NET :(
#3
adsi
#4
当然可以,用ADSI对象。给你一个我自己写的例子
'发布虚拟站点
'参数:
' strWebSite 虚拟站点名称
' strFriendlyName 程序名称
' strWebPath 网页文件路径
' strDefaultDoc 默认网站首页
Public Function WebVirtualDir(ByVal strWebSite As String, ByVal strFriendlyName As String, ByVal strWebPath As String, ByVal strDefaultDoc As String) As Boolean
Dim objADSI As Object
Dim objWebVDir As Object
On Error GoTo Lib_Err
Set objADSI = GetObject("IIS://LocalHost/W3SVC/1/Root")
Set objWebVDir = objADSI.Create("IIsWebVirtualDir", strWebSite)
objWebVDir.SetInfo
Set objWebVDir = objADSI.GetObject("IIsWebVirtualDir", strWebSite)
objWebVDir.AppCreate True
objWebVDir.Put "AppFriendlyName", strFriendlyName
objWebVDir.Put "AppRoot", "/LM/W3SVC/1/Root/" & strWebSite
objWebVDir.Put "Path", strWebPath
objWebVDir.Put "AppIsolated", 0
objWebVDir.Put "DefaultDoc", strDefaultDoc
objWebVDir.Put "AccessFlags", 535
objWebVDir.SetInfo
WebVirtualDir = True
Lib_End:
Set objWebVDir = Nothing
Set objADSI = Nothing
Exit Function
Lib_Err:
WebVirtualDir = False
strError = Err.Description
Err.Clear
Resume Lib_End
End Function
'发布虚拟站点
'参数:
' strWebSite 虚拟站点名称
' strFriendlyName 程序名称
' strWebPath 网页文件路径
' strDefaultDoc 默认网站首页
Public Function WebVirtualDir(ByVal strWebSite As String, ByVal strFriendlyName As String, ByVal strWebPath As String, ByVal strDefaultDoc As String) As Boolean
Dim objADSI As Object
Dim objWebVDir As Object
On Error GoTo Lib_Err
Set objADSI = GetObject("IIS://LocalHost/W3SVC/1/Root")
Set objWebVDir = objADSI.Create("IIsWebVirtualDir", strWebSite)
objWebVDir.SetInfo
Set objWebVDir = objADSI.GetObject("IIsWebVirtualDir", strWebSite)
objWebVDir.AppCreate True
objWebVDir.Put "AppFriendlyName", strFriendlyName
objWebVDir.Put "AppRoot", "/LM/W3SVC/1/Root/" & strWebSite
objWebVDir.Put "Path", strWebPath
objWebVDir.Put "AppIsolated", 0
objWebVDir.Put "DefaultDoc", strDefaultDoc
objWebVDir.Put "AccessFlags", 535
objWebVDir.SetInfo
WebVirtualDir = True
Lib_End:
Set objWebVDir = Nothing
Set objADSI = Nothing
Exit Function
Lib_Err:
WebVirtualDir = False
strError = Err.Description
Err.Clear
Resume Lib_End
End Function
#5
to:lcooky(今夜无雪) 非常感谢!!
还有两个问题呢
谁知?
还有两个问题呢
谁知?
#6
第一个问题,我给你 引见一个:
http://www.csdn.net/expert/Topic/282/282902.shtm
http://www.csdn.net/expert/Topic/282/282902.shtm
#7
to:lcooky(今夜无雪)&sonicdater(发呆呆) 非常感谢!!
还有两个问题呢
谁知?
还有两个问题呢
谁知?
#8
UP.
#9
结帐!
#10
lcooky(今夜无雪):
建立虚拟目录我会了,如何建立新的站点,
建立虚拟目录我会了,如何建立新的站点,
#1
建议用VB.NET
#2
But I don't know VB.NET :(
#3
adsi
#4
当然可以,用ADSI对象。给你一个我自己写的例子
'发布虚拟站点
'参数:
' strWebSite 虚拟站点名称
' strFriendlyName 程序名称
' strWebPath 网页文件路径
' strDefaultDoc 默认网站首页
Public Function WebVirtualDir(ByVal strWebSite As String, ByVal strFriendlyName As String, ByVal strWebPath As String, ByVal strDefaultDoc As String) As Boolean
Dim objADSI As Object
Dim objWebVDir As Object
On Error GoTo Lib_Err
Set objADSI = GetObject("IIS://LocalHost/W3SVC/1/Root")
Set objWebVDir = objADSI.Create("IIsWebVirtualDir", strWebSite)
objWebVDir.SetInfo
Set objWebVDir = objADSI.GetObject("IIsWebVirtualDir", strWebSite)
objWebVDir.AppCreate True
objWebVDir.Put "AppFriendlyName", strFriendlyName
objWebVDir.Put "AppRoot", "/LM/W3SVC/1/Root/" & strWebSite
objWebVDir.Put "Path", strWebPath
objWebVDir.Put "AppIsolated", 0
objWebVDir.Put "DefaultDoc", strDefaultDoc
objWebVDir.Put "AccessFlags", 535
objWebVDir.SetInfo
WebVirtualDir = True
Lib_End:
Set objWebVDir = Nothing
Set objADSI = Nothing
Exit Function
Lib_Err:
WebVirtualDir = False
strError = Err.Description
Err.Clear
Resume Lib_End
End Function
'发布虚拟站点
'参数:
' strWebSite 虚拟站点名称
' strFriendlyName 程序名称
' strWebPath 网页文件路径
' strDefaultDoc 默认网站首页
Public Function WebVirtualDir(ByVal strWebSite As String, ByVal strFriendlyName As String, ByVal strWebPath As String, ByVal strDefaultDoc As String) As Boolean
Dim objADSI As Object
Dim objWebVDir As Object
On Error GoTo Lib_Err
Set objADSI = GetObject("IIS://LocalHost/W3SVC/1/Root")
Set objWebVDir = objADSI.Create("IIsWebVirtualDir", strWebSite)
objWebVDir.SetInfo
Set objWebVDir = objADSI.GetObject("IIsWebVirtualDir", strWebSite)
objWebVDir.AppCreate True
objWebVDir.Put "AppFriendlyName", strFriendlyName
objWebVDir.Put "AppRoot", "/LM/W3SVC/1/Root/" & strWebSite
objWebVDir.Put "Path", strWebPath
objWebVDir.Put "AppIsolated", 0
objWebVDir.Put "DefaultDoc", strDefaultDoc
objWebVDir.Put "AccessFlags", 535
objWebVDir.SetInfo
WebVirtualDir = True
Lib_End:
Set objWebVDir = Nothing
Set objADSI = Nothing
Exit Function
Lib_Err:
WebVirtualDir = False
strError = Err.Description
Err.Clear
Resume Lib_End
End Function
#5
to:lcooky(今夜无雪) 非常感谢!!
还有两个问题呢
谁知?
还有两个问题呢
谁知?
#6
第一个问题,我给你 引见一个:
http://www.csdn.net/expert/Topic/282/282902.shtm
http://www.csdn.net/expert/Topic/282/282902.shtm
#7
to:lcooky(今夜无雪)&sonicdater(发呆呆) 非常感谢!!
还有两个问题呢
谁知?
还有两个问题呢
谁知?
#8
UP.
#9
结帐!
#10
lcooky(今夜无雪):
建立虚拟目录我会了,如何建立新的站点,
建立虚拟目录我会了,如何建立新的站点,