我试图使用一个arraylist作为String.Format的参数。Vb.NET与ArrayList的String.Format
msg = msg & String.Format("<td>{0}</td>" & _
"<td>{1}</td>" & _
"<td>{2}</td>" & _
"<td>{3}</td>" & _
"<td>{4}</td>" & _
"<td>{5}</td>" & _
"<td>{6}</td>" & _
"<td>{7}</td>" & _
"<td>{8}</td>", param)
,其中一个参数是一个ArrayList和内容因此(从观察名单中复制):
+ (0) 9 {Integer} Object
+ (1) 3 {Integer} Object
+ (2) 5 {Integer} Object
+ (3) "180" {String} Object
+ (4) 0D {Decimal} Object
+ (5) 6.788D {Decimal} Object
+ (6) #3/13/2009# {Date} Object
+ (7) "2004" {String} Object
+ (8) "" {String} Object
但这代码抛出一个出现FormatException
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
我错了,这是可能的使用数组列表?如果可能的话,为什么它会抛出这样的错误的任何线索?
感谢
http://msdn.microsoft.com/en-us/library/b1csw23d(v=VS.90).aspx它接受System.Object。这个参考文件基本上没有用处,只要举例等等。 虽然工作完美,但谢谢! – 2010-06-01 15:09:33