Results 1 to 2 of 2

Thread: Viewing Web Servers Log Files

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    183

    Viewing Web Servers Log Files

    Has anyone seen asp.net code to read the logfiles of an IIS server? I have seen lots for just asp (http://www.devarticles.com/content.p...leId=33&page=3)
    but I don't know how to convert this into asp.net, any ideas?

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    it is actually so much easier in asp net

    Code:
    Dim log As New System.Diagnostics.EventLog()
    			Dim logentry As System.Diagnostics.EventLogEntry
    			log.Log="Application"
    			For Each logentry in log.Entries
    			     MessageBox.Show(logentry.Message)
    			Next logentry
    Just change the part that says Application to whatever log you want(Application, Security, System)

    And change the the MessageBox.Show to output logentry.Message to either some asp .net labels or list box, or something else you wish.

    There are some other log data you can output but you have to look those up. If you have Visual Studio .NET, just use the intellisense for logentry. and see what other properties it has.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width