|
-
Nov 21st, 2004, 10:28 PM
#1
Thread Starter
Junior Member
exporting logs from VB.NET [solved]
I am writing an application that uses a custom eventLog for error / warning storage
VB Code:
If Not System.Diagnostics.EventLog.SourceExists("ILStep") Then
EventLog.CreateEventSource("ILStep", "ILStep")
End If
evtLog = New System.Diagnostics.EventLog("ILStep")
evtLog.Source = "ILStep"
and then to view the log, i created a new mmc panel
VB Code:
Shell("mmc ILStep.msc", AppWinStyle.NormalFocus)
The customer asked that the logs be exported and cleared weekly. Is there a way to automate the event viewer "Export" and "Clear log" commands through the framework?
Last edited by superuser666; Nov 23rd, 2004 at 12:34 AM.
-
Nov 21st, 2004, 11:00 PM
#2
Not sure about the framework, but in VB6 I would use these
APIs to do it.
Perhaps you could use them?
VB Code:
Private Declare Function BackupEventLog Lib "advapi32.dll" Alias "BackupEventLogA" _
(ByVal hEventLog As Long, ByVal lpBackupFileName As String) As Long
Private Declare Function ClearEventLog Lib "advapi32.dll" Alias "ClearEventLogA" _
(ByVal hEventLog As Long, ByVal lpBackupFileName As String) As Long
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 22nd, 2004, 12:06 AM
#3
Thread Starter
Junior Member
thx for the quick reply. i'll try
-
Nov 22nd, 2004, 12:12 AM
#4
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 25th, 2004, 12:05 AM
#5
Thread Starter
Junior Member
update:
decided not to bother writing scheduling software, bought a license for eventsentry to pass to the customer...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|