Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Classes & Source Code Thread, Write To Windows Event Log ... in Visual Basic Programming; Write To Windows Event Log ... Author : Gehan Fernando. Date Submitted : 9/17/2007 Category : Windows Operations Compatibility : ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=3059


Reply
LinkBack Thread Tools Display Modes
Write To Windows Event Log ...
 
 
The God Father
Developer's Avatar

Reply With Quote
 
Join Date: Jul 2008
Location: NDC
Posts: 5,425
31-08-2008, 08:02 PM
 
Write To Windows Event Log ...

Author: Gehan Fernando.
Date Submitted: 9/17/2007
Category: Windows Operations
Compatibility: .NET



PHP Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        WriteToEventLog
("Hello Where Are U", EventLogEntryType.Information, "VB.Net Application", "Application")


    
End Sub

    Private
Function WriteToEventLog(ByVal Entry As String, ByVal LogEntryType As System.Diagnostics.EventLogEntryType, _
                                     Optional ByVal AppName
As String = "VB.Net Application", _
                                     Optional ByVal LogName
As String = "Application") As Boolean


        Dim objeventlog
As New EventLog()

        
Try
            
If EventLog.SourceExists(AppName) = False Then
                EventLog
.CreateEventSource(AppName, LogName)
            
End If

            
objeventlog.Source = AppName
            objeventlog
.WriteEntry(Entry, LogEntryType)
        
Catch ex As Exception
            MessageBox
.Show(ex.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        
Finally
            objeventlog
.Dispose()
        
End Try

    End
Function
__________________
I Love Walking In The Rain Cuz Nobody Know I'm Crying !!
 
 
 
Reply

Classes & Source Code Thread, Write To Windows Event Log ... in Visual Basic Programming; Write To Windows Event Log ... Author : Gehan Fernando. Date Submitted : 9/17/2007 Category : Windows Operations Compatibility : ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=3059


Bookmarks

Tags
event, log, windows, write


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Write For the Web Developer Articles 0 16-12-2008 01:20 AM
How to write a Shell Search by Implementing IShellExtInit, IContextMenu Developer Delphi 0 27-11-2008 05:30 AM
Event Log Explorer 3.0 Developer Software and Programs 0 06-11-2008 06:24 AM
Farcaster's Event Attendance & vb Event Forums Integration Developer Mods for 3.6.x 0 29-10-2008 06:42 PM
vB Event Forums Developer Mods for 3.6.x 0 30-09-2008 12:13 AM