Feedback

Letzten Windows Fehler ausgeben

Sprache: C#

Diese Methode gibt den letzten Windows Fehler aus.
using System.ComponentModel;
using System.Runtime.InteropServices;

/// <summary>
/// Gets the last windows error.
/// </summary>
/// <returns></returns>
private string GetLastWindowsError()
{
   return new Win32Exception(Marshal.GetLastWin32Error()).Message;
}
using System.ComponentModel;
using System.Runtime.InteropServices;

/// <summary>
/// Gets the last windows error.
/// </summary>
/// <returns></returns>
private string GetLastWindowsError()
{
   return new Win32Exception(Marshal.GetLastWin32Error()).Message;
}