For WEB sites created using ASP. NET (VB), our call method is very simple:
Dim test As New Class1 ()
Test. CreateWebSit (webname, port, "D: VB", "localhost ")
The following is the Class1 Code. The Code is used to create a site. If the site name is available, it is automatically overwritten (Note: Actice DS Type Library must be referenced in this class)
Public Class Class1
Use localhost
'================================
Function CreateWebSit (ByVal WWWSiteName As String ,_
ByVal WWWTCPPort As String ,_
ByVal WWWFilesPath As String ,_
ByVal ComputerName As String) As Boolean
CreateWebSit = True
Dim TCPPort () As Object
'Create an Active Desktop '(IADS) object. First, you must use the Active DS 'type' library component in 'references 'in the 'probject' menu of VB.
Dim WWWServer As ActiveDs. IADs
Dim WWWService
Dim WWWVdir, WWWVdir2, WWWVdirRes As ActiveDs. IADs
Dim I As Integer
Dim HandleSameCase As Boolean
'Retrieve the W3SVC Service
WWWService = GetObject ("IIS: //" & ComputerName & "/W3SVC ")