C#弹窗提示

/// 
/// 调用外部库
/// 
public class WindowsMessage
{
    [DllImport("User32.dll", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = CharSet.Auto)]
    public static extern int MessageBox(IntPtr handle, string message, string title, int type);
    public static void AutoShutDown()
    {
        MessageBox(IntPtr.Zero, "倒计时10秒之后关机", "关机,下班!", 0);
    }
}

 

你可能感兴趣的:(.Net,framework,Windows)