请问老师,这段代码该如何修改呀,运行时显示:Collection was modified; enumeration operation may not execute.
Dim S7 As new List (of String)
For a As Integer = 0 To 9
For b As Integer = 0 To 9
For c As Integer = 0 To 9
S7.Add (CStr(a) & CStr(b) & CStr(c))
Next
Next
Next
For p As Integer = 0 To 2
For g As Integer = 0 To 9
If Tables("ZSHSB1").Rows(p)("S" & CStr(g)) = True Then
For Each v As String In S7
If v.Chars(p) = CStr(g) Then
S7.Remove(v)
End If
Next
End If
Next
Next
Dim d As String = ""
For t As Integer = 0 To (S7.Count-1)
d = d & S7(t) & " "
Next
Tables("ZSHSB1").Rows(0)("BZ") = d