如何查找有多少类实例我是C# [英] How To Find How Much Instance Of Class Is Alive I C#

查看:54
本文介绍了如何查找有多少类实例我是C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





任何人都可以给我一个程序,知道有多少类的实例是ic#.net

解决方案

你可以使用静态计数器,它在构造时递增。

查看下面的SO问题样本代码

如何在C#中找出一个类创建了多少个对象 [ ^ ]

计算实例课程 [ ^ ]

hi

can any one give me a programme to know how much instance of class is alive i c#.net

解决方案

you can use static counter which is incremented on construction.
check below SO questions for sample codes
how can i find out how many objects are created of a class in C#[^]
Count instances of the class[^]


这篇关于如何查找有多少类实例我是C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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