簡體   English   中英

從Windows 8.1寫入EventLog時,顯示消息“找不到源中事件ID 0的描述。”

[英]Writing to EventLog from Windows 8.1, message saying “The description for Event ID 0 from source cannot be found.”

我正在Windows 8.1版本6.3.9600上運行此程序,我真的需要一些最基本的簡化應用程序的幫助,這些應用程序可以寫入事件日志。 這是我的代碼:

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            EventLog.WriteEntry("Testing Application", "Testing data", EventLogEntryType.Information, 100);
        }
    }
}

執行后,我得到一個異常

and add value with data then there is no exception, but the event entry displays all this: 但是,如果我添加注冊表項並添加帶有數據 ,則沒有例外,但是事件條目顯示所有這些:

我有什么辦法可以在事件日志中僅顯示文本“ Testing data”? 還是Windows 8.1工作方式不同,我不知道嗎?

親切的問候

達姆揚

您需要為事件查看器設置消息文件。 看看找不到源事件ID的描述

簽出此答案,它確實滿足您的需要(編寫事件日志條目,而不會出現“找不到描述”錯誤,並且無需注冊自定義事件源

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM