-2
에 추가 할 수 있습니다.는 IEnumerable 항목 내가 클래스가 NameValueCollection은
이제 모든 항목을 CustomerItems
에서 NameValueCollection
으로 추가하고 싶습니다.
NameValueCollection target = new NameValueCollection();
// I want to achieve
target.Add(x,y); // For all the items in CustomerItems
// where - x - is of the format - Line1 - for first item like "Line" + i
// "Line" is just a hardcodedvalue to be appended
// with the respective item number in the iteration.
// where - y - is the concatenation of all the values for that specific line.
어떻게 구현합니까?
Line [i] 란 무엇입니까? –
@CoryNelson Pls는 업데이트 된 질문을 참조하십시오. – GilliVilla
코드에서 주석에만 "줄"을 언급했습니다. 그게 뭐야? 왜 foreach와 함께 잘못 됐어? –