Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
C# を使用して Windows のすべてのイベント ログをクリアするにはどうすればよいですか?
using System.Diagnostics; using(var eventLog = new EventLog("Security", System.Environment.MachineName); eventLog.Clear();
セキュリティ イベント ログを削除します。
すべて削除するには:
foreach (var eventLog in EventLog.GetEventLogs()) { eventLog.Clear(); eventLog.Dispose(); }