Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Anyone have any code that backup the eventlog entries and their associated data? I was trying to code something myself using MSDN for reference however I cannot get Eventlog.entries() to work for me. It gives me some error about formatting using library(IES)...i dunno. Let me know if anyone has any ideas.
Posted

This will make you loop trough every eventlog entries.

 

Dim A, B As Integer

	Dim Events() As EventLog
	Events = EventLog.GetEventLogs()

	For A = 0 To Events.Length - 1
		For B = 0 To Events(A).Entries.Count - 1
			Debug.WriteLine(Events(A).LogDisplayName & ": " & Events(A).Entries(B).Message)
		Next
	Next

 

You might want to change the debug.writeline with something else like writing them to a file.

Posted

Worked

 

That works nicely, got everything backing up nicely. I think it needs a better interface though, do you know any tutorials where I can find out how to make windows.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...