Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27201

VS 2010 [RESOLVED] Updating subitem in listview

$
0
0
Hey Guys,

I can never seem to remember how to do this lol what i'm doing is looping a listview with 2 columns, the first column contains urls and the second is blank ready to be updated with either "YES" or "NO"

code:

Code:

        For Each url As ListViewItem In listViewMain.CheckedItems

            '// SEND REQUEST
            Dim request As WebRequest = WebRequest.Create("http://site.com/&domain=" & url.SubItems(0).Text)
            '// GET THE RESPONSE
            Dim response As WebResponse = request.GetResponse()
            '// THE DATASTREAM RETURNED BY THE REQUEST
            Dim dataStream As Stream = response.GetResponseStream()
            '// OPEN THE RESPONSE IN A STREAMREADER
            Dim reader As New StreamReader(dataStream)
            '// READ THE CONTENT TO THE END
            Dim responseFromServer As String = reader.ReadToEnd()

            '// IF STRING CONTAINS...
            If (responseFromServer.Contains(":false")) Then
                '// FALSE
            Else
                '// TRUE
            End If

            'formDebug.Show()
            'formDebug.txtBoxDebug.Text = responseFromServer

        Next

I'm not sure the code to update the subitem in every url.SubItems(0).Text row like:

site1.com YES
site2.com NO

etc

I cannot remmeber how to do this!

cheers for any help guys!

Graham

Viewing all articles
Browse latest Browse all 27201

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>