是否可以在.net中取消引用变量 [英] Is it possible to dereference a variable in .net

查看:69
本文介绍了是否可以在.net中取消引用变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一组对象。像文本框一样,在asp.net网页中,除了数字差异之外,其他ID类似,如id1,id2,id3等....每个都有不同的文本值。



在后面的代码中,我可以声明一个名为ID的变量字符串并将其值设置为id,然后在循环中连接数字值,如1,2,3等,并取消引用该字符串以获取每个变量值?

If I have a set of objects. like textboxes, in an asp.net web page, with ids that are similar except for numeric difference, like id1, id2, id3, etc.... Each having a different text value.

In the code behind, can I declare a variable string named ID and set its value to id, then in a loop, concatenate numeric values like 1,2,3, etc to it and dereference that string to get each variables value?

推荐答案

您可能对数组或列表感兴趣。
You might be interested in an array or a list.


这篇关于是否可以在.net中取消引用变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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