Public Class AAA
<Required()> _
<StringLength(100, ErrorMessage:="{0} 必须至少包含 {2} 个字符,最多包含 {1} 个字符。", MinimumLength:=1)> _
<Display(Name:="选项")> _
Public Property Item_1 As String
<Required()> _
<StringLength(100, ErrorMessage:="{0} 必须至少包含 {2} 个字符,最多包含 {1} 个字符。", MinimumLength:=1)> _
<Display(Name:="选项")> _
Public Property Item_2 As String
<Required()> _
<StringLength(100, ErrorMessage:="{0} 必须至少包含 {2} 个字符,最多包含 {1} 个字符。", MinimumLength:=1)> _
<Display(Name:="选项")> _
Public Property Item_3 As String
......
End Class
如果要定义这样的属性 Item_1,Item_2,Item_3...... 一直到100 有没有简便方法?小弟刚学vb.net 不是很明白
------解决思路----------------------
用索引器
http://support.microsoft.com/kb/311323