如何计算一个消息框在C#中出现多少次? [英] How do i go about counting how many times a messagebox appears in c#?

查看:94
本文介绍了如何计算一个消息框在C#中出现多少次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图让我的程序计算程序中某个特定消息框在运行时出现的次数。

I am trying to get my program to Count how many times a certain messagebox in my program appears while it is running.

我一直在寻找如何执行此操作的步骤似乎我将需要使用int count,但是我不确定如何为Messageboxes进行编码,因为我只能找到字符串和数组的计数代码。

I have looked up how to do this and it seems that I will need to use int count but I'm not sure how to code this for Messageboxes as I can only find count code for strings and arrays.

推荐答案

最好为MessageBox类创建一些静态包装器类,然后将其计入某种静态变量中。

It is better idea to make some static wrapper class for MessageBox class and count it there in some kind of static variable.

这篇关于如何计算一个消息框在C#中出现多少次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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