Creating a suimple virtual directory with default rights by:Microsoft
|
I have a web site called www.test.com
I have a folder under the wwwroot called \testfolder How do I turn \testfolder\ into a virtual directory.
I don't need rights and settings, I've figured that part out, I just get lost setting up the "System.DirectoryServices.DirectoryEntry" and then executing the childern.add()
|
| | Reply: by:Paul Clement
|
| |
See if the following helps:
Creating Sites and Virtual Directories Using System.DirectoryServices http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/iis/creating_a_virtual_directory_using_system_directoryservices.asp
|
| | Reply: by:Mas G
|
| | Great Thanks but what Does serverID in DirectoryEntry root=new DirectoryEntry("IIS://localhost/W3SVC/" + serverID + "/Root"); mean
Its not server name again is it?
|
| | Reply: by:Paul Clement
|
| | You have to query IIS in order to determine the server instance for the default web site. Here is some simple VB code to do this:
Function FindInstanceIDForSite() As Integer Dim intServerID As Integer Dim objIIS As Object On Error Resume Next
For intServerID = 1 To 512 Set objIIS = GetObject("IIS://Localhost/w3svc/" & intServerID) If (Err.Number <> 0) Then FindInstanceIDForSite = intServerID MsgBox objIIS.ServerComment Exit Function End If Next
FindInstanceIDForSite = 0
End Function
|
0 Comments:
Post a Comment