Я надеюсь, что вы мне поможете ...
Суть проблемы:
Существует провайдер (поставщик, источник) событий, который называется "Service Control Manager" в журнале событий System. В реестре EventMessageFile этого провайдера содержит путь к файлу содержащему сообщения -- % SystemRoot% \ system32 \ services.exe. В нём содержится сообщение с ID = 7036 и это сообщение выглядит как "% 1 служба перешла в состояние % 2 ". Вы можете генерировать его очень просто путем остановки или запуска каких-либо служб в services.msc.
Все, что я хочу это сделать такую запись сам в журнале System от имени Service Control Manager.
Вот мой простенький код:
Код: Выделить всё
using System;
using System.Diagnostics;
using System.Diagnostics.Eventing;
class MySample
{
public static void Main()
{
EventLog myNewLog = new EventLog("System", ".", "Service Control Manager");
myNewLog.WriteEntry("Test",EventLogEntryType.Information, 7036);
}
}
"The description for Event ID 7036 from source Service Control Manager cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
Test
the message resource is present but the message is not found in the string/message table
вместо ожидаемого "Служба Test перешла в состояние %2" .
В чем моя ошибка?