如何在asp.net中查找业务对象的属性长度或计数 [英] How to find properties length or count of a business object in asp.net

查看:70
本文介绍了如何在asp.net中查找业务对象的属性长度或计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

任何人都可以告诉我如何在asp.net中找到一个业务对象的属性.

我正在尝试通过使用以下代码来获取此值:

Hi all,

Can any one please tell me how can i find number of properties of a businessobject in asp.net.

i am trying to get this value by using below code:

Type objType = obj.GetType();
  PropertyInfo[] objPropertiesArray = objType.GetProperties();



但是在这里我没有得到价值.紧急情况下任何人都可以请我帮助找到它.

在此先谢谢您.



but here i didn''t get the value. its urgent can anyone please help me to find this please.

Thanks in advance.

推荐答案

您好

试试这个

Hi

try this

Object obj = new Object();

           PropertyInfo[] propertyInfos;
           propertyInfos = typeof(Object).GetProperties();

           Response.Write(propertyInfos.Count());




问候,
T




Regards,
T


这篇关于如何在asp.net中查找业务对象的属性长度或计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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