ADSI Path to URL

A

Armando Canez

Hi all:

I have a problem. I 'm modifying Virtual directories using the DirectoryEntry class
Dim webapp As DirectoryEntry = New DirectoryEntry("IIS://localhost/W3SVC/" + siteID.ToString() + "/ROOT/" + virtualDir)

To get the physical path I use the Path property:

dim physicalPath = DirectCast(webapp.Properties("Path").Item(0), String)

'(BTW : Be careful if you use it. Sometimes I´ve seen this property empty)

However, I cannot find a way to conver ADSI Path to a valid URL if it´s not the default site. (site <> 1)

if it is the default website, i simply Replace("IIS://localhost/W3SVC/1/ROOT", "http//localhost")

But if it is not, How can i build a valid URL? what do I have to check? SSL? Port? address?



In Short: I need to build a ADSIPathToURL Function

Public Function ADSIPathToUrl(ByVal adsiPath As String) As String

where adsiPath is an ADSI Path like: "IIS://localhost/W3SVC/SiteID/ROOT/myVirtualDir"

and returns a valid URL I can use in Internet Explorer or such for that site ...

Any Ideas?

Armando Canez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top