class Class1
{
private static string _a = null;
private static int _b = 0;
private static ParameterDirection _c;
public string SetA
{
set { _a = value; }
get { return _a; }
} public int SetB
{
set { _b = value; }
get { return _b; }
} public ParameterDirection SetC
{
set { _c = value; }
get{return _c;}
}
}
static void Main(string[] args)
{
Class1 cls = new Class1();
cls.SetA = "AA";
cls.SetB = 1;
cls.SetC = System.Data.ParameterDirection.Output; List<Class1> lst = new List<Class1>();
table.Add(cls);
foreach (object obj in lst)
{
//这里该怎么遍历lst中Class1的属性值呢?我要得到AA,1,output
//反射用的不多,看了些资料,是能得到方法名啊,属性字段之类的,我要获得属性中的值
//或者你可以用你知道的方法告诉我,谢谢!在线等!
}
}
{
private static string _a = null;
private static int _b = 0;
private static ParameterDirection _c;
public string SetA
{
set { _a = value; }
get { return _a; }
} public int SetB
{
set { _b = value; }
get { return _b; }
} public ParameterDirection SetC
{
set { _c = value; }
get{return _c;}
}
}
static void Main(string[] args)
{
Class1 cls = new Class1();
cls.SetA = "AA";
cls.SetB = 1;
cls.SetC = System.Data.ParameterDirection.Output; List<Class1> lst = new List<Class1>();
table.Add(cls);
foreach (object obj in lst)
{
//这里该怎么遍历lst中Class1的属性值呢?我要得到AA,1,output
//反射用的不多,看了些资料,是能得到方法名啊,属性字段之类的,我要获得属性中的值
//或者你可以用你知道的方法告诉我,谢谢!在线等!
}
}
解决方案 »
- 怎样清空组合框中的项?
- 字符串问题!急急急帮忙处理下呀!
- 给定一个整数数组,其中元素的取值范围为0到10000,求其中出现次数最多的数
- 我用destination.ascx写了一个连动模板,有一个页面要用两次,就出现了问题
- 兄弟们,推荐一个统计C#2005代码的好工具!
- C#编程封局域网中其它计算机IP地址或端口号
- Datagridview中column.Items..(为什么没有selectIndex,和selectValue方法啊,应该怎么取值和设置其默认的值啊)
- C# 里如何把一个byte[] 追加到另一个大byte[] 里?
- 数据库问题
- dotNet的重大BUG?!
- 面向对象的郁闷~~!无法下手,请教下一步该干什么?
- C#: 如何运行单个的winform以便测试它的功能?
{
Class1 cs = obj;
string A = cs.SetA;
}
foreach(Class1 c in lst)
{
***=c.SetA;
***=c.SetB;
.....
}
{
Class1 cls = new Class1();
cls.SetA = "AA";
cls.SetB = 1;
cls.SetC = System.Data.ParameterDirection.Output; List<Class1> lst = new List<Class1>();
table.Add(cls); foreach (Class1 obj in lst)
{
Console.WriteLine(obj.SetA);
Console.WriteLine(obj.SetB);
}
}