You are developing an application by using C#. The application will write events to an event log. You plan to deploy the application to a server.
You create an event source named AppSource and a custom log named AppLog on the server.
You need to write events to the custom log.
Which code segment should you use?
A:

B:

C:

D:

正解:A
Explanation/Reference:
Explanation:
Source should be AppSource:
New-EventLog
Creates a new event log and a new event source on a local or remote computer.
Parameters include:
-Source<String[]>
Specifies the names of the event log sources, such as application programs that write to the event log.
This parameter is required.