本人是.net新手,想在WEB的登录页面中做一个登陆验证时能弹出的信息框,可是用
MessageBox.Show如下
String message = "帐号或密码有误!";
string caption = "提示";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
MessageBox.Show(message, caption, buttons,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1,
MessageBoxOptions.RightAlign);运行后出现如下异常信息:
异常详细信息: System.InvalidOperationException: 在应用程序未以 UserInteractive 模式运行时显示模式对话框或窗体是无效的操作。请指定 ServiceNotification 或 DefaultDesktopOnly 样式,以显示服务应用程序发出的通知。
不知如何才能正确使用,求教
MessageBox.Show如下
String message = "帐号或密码有误!";
string caption = "提示";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
MessageBox.Show(message, caption, buttons,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1,
MessageBoxOptions.RightAlign);运行后出现如下异常信息:
异常详细信息: System.InvalidOperationException: 在应用程序未以 UserInteractive 模式运行时显示模式对话框或窗体是无效的操作。请指定 ServiceNotification 或 DefaultDesktopOnly 样式,以显示服务应用程序发出的通知。
不知如何才能正确使用,求教
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货