我使用休耕代碼導出一個Windows事件日誌:異常在出口的EventLog
var els = new EventLogSession();
els.ExportLogAndMessages("Application",
PathType.LogName,
"*[System[Provider[@Name='Prayon.Client']]]",
tempEventLogPath,
false,
CultureInfo.CurrentCulture);
這通常工作。但一臺機器上,我得到的休耕例外:
System.Diagnostics.Eventing.Reader.EventLogException: Der Verzeichnisname ist ungültig
bei System.Diagnostics.Eventing.Reader.EventLogException.Throw(Int32 errorCode)
bei System.Diagnostics.Eventing.Reader.NativeWrapper.EvtArchiveExportedLog(EventLogHandle session, String logFilePath, Int32 locale, Int32 flags)
bei System.Diagnostics.Eventing.Reader.EventLogSession.ExportLogAndMessages(String path, PathType pathType, String query, String targetFilePath, Boolean tolerateQueryErrors, CultureInfo targetCultureInfo)
"Der Verzeichnisname ist ungültig"
意味着英語:"The pathname is invalid"
的應用程序事件日誌中現有的和tempEventLogPath
也是有效的。
有人知道,有什麼可能是錯的?
tempEventLogPath的價值是什麼? –