如何获取变量名称 [英] how to get the variable name

查看:110
本文介绍了如何获取变量名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





如何使用c#.net获取变量名称

请给我一个正确的结论。



问候,

sathya。

Hi ,

How to get the variable name using c#.net
Please give me the proper conclusion.

Regards,
sathya.

推荐答案

http://stackoverflow.com / questions / 716399 / c-sharp-how-do-get-a-variables-name-as-it-it-physical-in-its-dec- [ ^ ]

http://stackoverflow.com/questions/5053521/getting-variable-by-name-in-c-sharp [ ^ ]


HI,



获取局部变量名称是不可能的,但是你可以通过Reflection得到一个字段或属性。


It''s impossible to get a local variable name,but you can get a field or property by way of Reflection.


这篇关于如何获取变量名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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