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
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