How to access logfile directory path from IIS

G

Guest

I need to programmatically access the IIS logfile path, so that my webservice
could create a new file in that directory and write to it....

I searched the net and could find a way to do it.....

Dim IISOBJ, Servername, WebSiteID
Dim flag2 As String
flag2 = ""

Servername = "localhost"
WebSiteID = 1

IISOBJ = GetObject("IIS://" & Servername & "/W3SVC/" & WebSiteID)

If (IISOBJ.LogType = 0) Then
flag2 = "Disabled"
Else
flag2 = "Enabled"
End If
flag2 = IISOBJ.LogFileDirectory

But the above code gives a "run-time exception thrown : System.Exception -
Cannot create ActiveX component." at GetObject("IIS://" & Servername &
"/W3SVC/" & WebSiteID)...

Any solution would be appreciated....

Also, if there are any other ways of doing this, it would be of great help
to me...

thanks!
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top