SecurityException: 未找到源,不过,未能搜索部分或所有事件日志。 若要创建源,您需要用于读取所有事件日志的权限以确保新的源名称是唯一的。 不可访问的日志: Security, State。 --Action: 0 --Zone: MyComputer StackTrace: 在 System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate) 在 System.Diagnostics.EventLog.SourceExists(String source, String machineName, Boolean wantToCreate) 在 System.Diagnostics.EventLogInternal.VerifyAndCreateSource(String sourceName, String currentMachineName) 在 System.Diagnostics.EventLogInternal.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) 在 System.Diagnostics.EventLog.WriteEntry(String message) 在 System.Diagnostics.EventLogTraceListener.WriteLine(String message) 在 System.Diagnostics.TraceInternal.WriteLine(String message) 在 ICSharpCode.AvalonEdit.Utils.ExtensionMethods.CheckIsFrozen(Freezable f) 在 ICSharpCode.AvalonEdit.Rendering.TextView.CreateGlobalTextRunProperties() 在 ICSharpCode.AvalonEdit.Rendering.TextView.CreateAndMeasureVisualLines(Size availableSize) 在 ICSharpCode.AvalonEdit.Rendering.TextView.MeasureOverride(Size availableSize) 在 System.Windows.FrameworkElement.MeasureCore(Size availableSize) 在 System.Windows.UIElement.Measure(Size availableSize) 在 System.Windows.ContextLayoutManager.UpdateLayout() 在 System.Windows.Interop.HwndSource.Process_WM_SIZE(UIElement rootUIElement, IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam) 在 System.Windows.Interop.HwndSource.LayoutFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)