コード例 #1
0
ファイル: AppEvents.cs プロジェクト: rajeshwarn/Music1
        public void WriteToLog(string message, EventLogEntryType type,
                               CategoryType category, EventIDType eventID, byte[] rawData)
        {
            if (log == null)
            {
                throw (new ArgumentNullException("log",
                                                 "This Event Log has not been opened or has been closed."));
            }

            log.WriteEntry(message, type, (int)eventID, (short)category, rawData);
        }
コード例 #2
0
        public void WriteToLog(string message, EventLogEntryType type,
                               CategoryType category, EventIDType eventID, byte[] rawData)
        {
            if (Log == null)
            {
                throw (new ArgumentNullException(nameof(Log),
                                                 "This Event Log has not been opened or has been closed."));
            }
            EventLogPermission evtPermission =
                new EventLogPermission(EventLogPermissionAccess.Write, MachineName);

            evtPermission.Demand();

            Log.WriteEntry(message, type, (int)eventID, (short)category, rawData);
        }
コード例 #3
0
        public void WriteToLog(string message, EventLogEntryType type,
                               CategoryType category, EventIDType eventID)
        {
            if (Log == null)
            {
                throw new ArgumentNullException(nameof(Log),
                                                "This Event Log has not been opened or has been closed.");
            }

            EventLogPermission eventLogPermission =
                new EventLogPermission(EventLogPermissionAccess.Write, MachineName);

            eventLogPermission.Demand();

            // If you get a SecurityException here, see the notes at the
            // top of the class
            Log.WriteEntry(message, type, (int)eventID, (short)category);
        }
コード例 #4
0
ファイル: AppEvents.cs プロジェクト: codedecay/SBTransfer
 public void WriteToLog(string message, EventLogEntryType type, CategoryType category, EventIDType eventID, byte[] rawData)
 {
     if (this.log == null)
     throw new ArgumentNullException("log", "This Event Log has not been opened or has been closed.");
       this.log.WriteEntry(message, type, (int) eventID, (short) category, rawData);
 }
コード例 #5
0
 public void LogOrNotify(string message, EventLogEntryType type, CategoryType category, EventIDType eventID)
 {
 }