2014-07-22 74 views
0

我需要您關於應用程序和服務日誌的幫助。我創建了一個Windows服務應用程序,但問題是在註冊表(HKEY_LM> SYSTEM> CurrentControlSet> Services> EventLog)中存在源和日誌,但是在事件查看器中未顯示應用程序和服務日誌。事件查看器 - 應用程序和服務日誌

我在這裏使用VB.NET是我的代碼:

Public Const EvtLogSource As String = "MySource" 
    Public Const EvtLogName As String = "ExportLog" 
    Public EventLog1 As New EventLog(EvtLogName, ".", EvtLogSource) 

    If Not System.Diagnostics.EventLog.SourceExists(EvtLogSource) Then 
     System.Diagnostics.EventLog.CreateEventSource(EvtLogSource, EvtLogName) 
    End If 

    EventLog1.Source = EvtLogSource 

回答

0

我剛剛重新啓動我的機器。我的事件日誌顯示。

相關問題