长度> 1但只进行一次for循环

时间:2014-06-02 05:58:23

标签: vb.net

代码:

Private Sub RefreshToDoList() Handles MyBase.Load
    If FileExists(NewEvent.ToDoItems_Path) And FileExists(NewEvent.ToDoDates_Path) And FileExists(NewEvent.ToDoContents_Path) Then
        If Not ContentOf(NewEvent.ToDoItems_Path).ToString = "" And Not ContentOf(NewEvent.ToDoDates_Path).ToString = "" And Not ContentOf(NewEvent.ToDoContents_Path).ToString = "" Then
            ToDoListItems = ContentOf(NewEvent.ToDoItems_Path).ToString.Split(New String() {Environment.NewLine}, StringSplitOptions.None)
            ToDoListDates = ContentOf(NewEvent.ToDoDates_Path).ToString.Split(New String() {Environment.NewLine}, StringSplitOptions.None)
            ToDoListContents = ContentOf(NewEvent.ToDoContents_Path).ToString.Split(New String() {Environment.NewLine}, StringSplitOptions.None)
        End If


        If ToDoListItems.Length = ToDoListDates.Length And ToDoListItems.Length = ToDoListContents.Length Then
            For count As Integer = 0 To ToDoListItems.Length - 1
                ToDoListBox.Items.Add(ToDoListItems(count))
                ToDoListInfo(count) = "Date : " + ToDoListDates(count) + Convert.ToString(Environment.NewLine + Environment.NewLine) + "Content : " + ToDoListContents(count)
            Next
        End If
    End If
End Sub

已选中,ToDoListItems.Length3,但ToDoListBox中只有一个项目。

此代码中的问题是什么?它似乎在for循环中。

0 个答案:

没有答案