HTTPModule on IIS 6 to execute on Web Folder requests?

252 Views Asked by At

Is it possible to use an HTTP Module to monitor requests to a site via Web Folders in IIS 6? I've got a very simple app set up with an HTTP Module which I've referenced in my Web.config like this:

<httpModules>
   <add name="MyCustomModule" type="SimpleTest.MyCustomModule"/>
</httpModules>

In the module, I've got code set up to write to a log file on the "C" Drive when the BeginRequest event fires:

Private Sub BeginRequest(sender As Object, e As EventArgs)
    Dim oHttpApplication As HttpApplication = CType(sender, HttpApplication)
    Using file As System.IO.StreamWriter = IO.File.AppendText("C:\LOG.TXT")
        file.WriteLine("got to Begin request for path: " & oHttpApplication.Request.FilePath)
    End Using
End Sub

Now if I navigate to Http://localhost/default.aspx I'll see an entry show up in my Log file like this:

got to Begin request for path: \default.aspx

But if I open up a folder (a sub folder within my site) as a Web Folder from Internet Explorer, no requests are logged. Mapping a drive to that folder has the same effect.

Is it possible to have an HTTP Module execute on requests to Web Folders or a Mapped Drive on a machine running IIS 6?

If so, does it require any additional IIS configuration?

0

There are 0 best solutions below