diff --git a/snippets/csharp/System.Diagnostics.Eventing.Reader/EventLogInformation/Attributes/Project.csproj b/snippets/csharp/System.Diagnostics.Eventing.Reader/EventLogInformation/Attributes/Project.csproj new file mode 100644 index 00000000000..543f1390dc5 --- /dev/null +++ b/snippets/csharp/System.Diagnostics.Eventing.Reader/EventLogInformation/Attributes/Project.csproj @@ -0,0 +1,12 @@ + + + + Exe + net10.0 + + + + + + + diff --git a/snippets/csharp/System.Diagnostics.Eventing.Reader/EventLogInformation/Attributes/attributes.cs b/snippets/csharp/System.Diagnostics.Eventing.Reader/EventLogInformation/Attributes/attributes.cs index c28b52bf7ac..9d1907d9982 100644 --- a/snippets/csharp/System.Diagnostics.Eventing.Reader/EventLogInformation/Attributes/attributes.cs +++ b/snippets/csharp/System.Diagnostics.Eventing.Reader/EventLogInformation/Attributes/attributes.cs @@ -1,7 +1,10 @@ -// -using System.Diagnostics.Eventing.Reader; +using System.Diagnostics.Eventing.Reader; using System.IO; -EventLogInformation eventLogInformation; +using EventLogSession session = new(); +EventLogInformation eventLogInformation = + session.GetLogInformation("Application", PathType.LogName); + +// FileAttributes? fileAttributes = (FileAttributes?)eventLogInformation.Attributes; //