列表框限制行数

时间:2015-06-20 09:54:40

标签: vb.net for-loop listbox

我有一个循环浏览列表框中项目的应用程序。

问题是列表框只保存了大约1300行数据,我需要循环更像3000.

除了使用列表框控件之外,我有哪些选择。

以下是我的代码片段:

 Dim count As Integer = ListBox1.Items.Count
    For n As Integer = 0 To ListBox1.Items.Count - 1
        Dim l_text As String = CStr(ListBox1.Items(n))

        Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("https://www.myurl.com/data.feed?text=" & l_text & "")
        Dim response As System.Net.HttpWebResponse = request.GetResponse()

        Select Case response.StatusCode

            Case System.Net.HttpStatusCode.OK

                Dim stream As System.IO.Stream = response.GetResponseStream()
                Dim reader As New System.IO.StreamReader(stream)
                Dim contents As String = reader.ReadToEnd()
                Dim document As New System.Xml.XmlDocument()

                document.LoadXml(contents)

                Dim ds As DataSet
                ds = New DataSet()
                ds.ReadXml(New XmlNodeReader(document))

                If ds.Tables.Count <= 4 Then

                    'Do Nothing

                Else

                 'Do Something

非常感谢任何帮助。

0 个答案:

没有答案