读书人

帮小弟我看看这个数组如何传呀

发布时间: 2012-02-03 22:02:47 作者: rapoo

帮我看看这个数组怎么传呀
Branch.GetAllBranchs()反回的是Branch[]
Branch里有一个Code属性(string)


现在声明一个string []str
怎么样和上边的Branch里边的Code匹配呀?

[解决办法]
str[0]?
[解决办法]
Branch [] b = Branch.GetAllBranchs();
string [] str = new string[b.Length];

for(int i = 0; i < str.Length; i++)
{
str[i] = b[i].Code;
}

读书人网 >asp.net

热点推荐