15.02.2015 Views

C# 4 and .NET 4

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

event logging ❘ 481<br />

Language=English<br />

Connection successful.<br />

.<br />

MessageId = 1001<br />

Severity = Error<br />

Facility = Application<br />

SymbolicName = MSG_CONNECT_FAILED_1001<br />

Language=English<br />

Could not connect to server %1.<br />

.<br />

MessageId = 1002<br />

Severity = Error<br />

Facility = Application<br />

SymbolicName = MSG_DB_UPDATE_1002<br />

Language=English<br />

Database update failed.<br />

.<br />

MessageId = 1003<br />

Severity = Success<br />

Facility = Application<br />

SymbolicName = APP_UPDATE<br />

Language=English<br />

Application %%5002 updated.<br />

.<br />

; // — Event log display name -<br />

; // ********************************************************<br />

MessageId = 5001<br />

Severity = Success<br />

Facility = Application<br />

SymbolicName = EVENT_LOG_DISPLAY_NAME_MSGID<br />

Language=English<br />

Professional <strong>C#</strong> Sample Event Log<br />

.<br />

; // — Event message parameters -<br />

; // Language independent insertion strings<br />

; // ********************************************************<br />

MessageId = 5002<br />

Severity = Success<br />

Facility = Application<br />

SymbolicName = EVENT_LOG_SERVICE_NAME_MSGID<br />

Language=English<br />

EventLogDemo.EXE<br />

.<br />

code snippet EventLogDemo/EventLogDemoMessages.mc<br />

Use the Messages Compiler, mc.exe, to create a binary message file. The comm<strong>and</strong> mc –s<br />

EventLogDemoMessages.mc compiles the source file containing the messages to a messages file with the<br />

.bin extension <strong>and</strong> the file Messages.rc, which contains a reference to the binary message file:<br />

mc -s EventLogDemoMessages.mc<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!