如何将值访问到列表中 [英] How to access the values into list
本文介绍了如何将值访问到列表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
public student()
{
public 列表< student_details> studentdetails = 新列表< student_details>();
public student() // constructor
{
Student_details s = new Student_details();
{
s.Student_Name = // 这里我可以访问Student_details类的值
}
}
}
public Student_details()
{
public string Student_Name { get ; set ;}
// 我得到学生的价值使用另一个c#文件从xml命名
}
解决方案
参考:
http://www.dotnetperls.com/list [ ^ ]
这可能会有所帮助。
嗨..使用这样的代码...
Student_details s = new Student_details()
{
Student_Name = abcd
} ;
public student()
{
public List<student_details>studentdetails=new List<student_details>();
public student()//constructor
{
Student_details s=new Student_details();
{
s.Student_Name=//here i have access the value from Student_details class
}
}
}
public Student_details()
{
public string Student_Name{get;set;}
//I am getting a value of student name from xml using another c# file
}
解决方案
Refer:
http://www.dotnetperls.com/list[^]
This may help.
Hi.. Use code like this...
Student_details s=new Student_details() { Student_Name = "abcd" };
这篇关于如何将值访问到列表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文