如何调用window.alert(QUOT;消息");从C#? [英] How to call window.alert("message"); from C#?

查看:155
本文介绍了如何调用window.alert(QUOT;消息");从C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于一定条件下我自己的异常,并要在控制谈到这个catch块引发警报

 赶上(ApplicationException的前)
{
    //想在这里调用window.alert功能
}


解决方案

你的意思是,一个消息框?

  MessageBox.Show(错误信息,错误标题,MessageBoxButtons.OK,MessageBoxIcon.Exclamation);

点击此处了解详情:<一href=\"http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox(v=VS.100).aspx\">http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox(v=VS.100).aspx

I have my own exception based on some condition and want to raise an alert when control comes in this catch block

catch (ApplicationException ex)
{
    //want to call window.alert function here
}

解决方案

Do you mean, a message box?

MessageBox.Show("Error Message", "Error Title", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

More information here: http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox(v=VS.100).aspx

这篇关于如何调用window.alert(QUOT;消息&QUOT;);从C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆