Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can a VB App read IIS settings?

Status
Not open for further replies.

MattWoberts

Programmer
Oct 12, 2001
156
GB
Hi,

I need to get my VB6 COM Dlls, to read a file from a web on the same server. All I know is the name of the web - so for example "MyWebApp". Is there any way in VB6 that given the name of the web app I can determine the physical location of this on the machine, so I can go and read a file from it?

Many thanks!
Matt
 
The quick answer is yes, it can.

Here is a link to MSDN on some info on how to. Note that this is for IIS 6.0 which ships with Windows 2003.


I don't have the time to write a solution for you with this.

Please let me know if this helps you and if you need further, more specific help.
 
Thanks - I'll read through the documentation and see what I can come up with!
 
Do a google search for IIS Metabase.

The metabase is a programatically searchable registry-type-thing used by IIS and I think you will find the info you need within it.
 
Finally......got round to this.

Thanks both "bjd4jc" and "Sheco" for providing me with the pointers here to get me started. If anyone else ends up here looking for the same answer, then heres some VB6 Code that does exactly what I wanted:

Code:
    Dim objApp As Object
    Set objApp = GetObject("IIS://LocalHost/w3svc/1/ROOT/" & strWebName)
    '
    MsgBox objApp.Path

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top