Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42215

VS 2010 Double output

$
0
0
hello everyone. i am making a app wich holds a list and compares it to a list what it gets from online database
to check if that person is online on the website

the problem i have is no matter what way i put it. it does everything many times over.

vb.net Code:
  1. Dim returnValue As String = html
  2.         Dim usernames As String() = returnValue.Split("|")
  3.         If returnValue = "" Then
  4.             MsgBox("error cannot pull players please check data and make sure the server has querry enabled")
  5.         Else
  6.  
  7.  
  8.             For Each Namex In ListViewEx2.Items
  9.                 For Each username In usernames
  10.                     username = username.Trim
  11.                    
  12.                     If Namex.text = username Then
  13.                         If Namex.subitems(1).text = "offline" Then
  14.  
  15.                             If My.Settings.notify = True Then
  16.                                 NotifyIcon1.BalloonTipText = "player " & Namex.text & " is now online!"
  17.                                 NotifyIcon1.ShowBalloonTip(2000)
  18.                             End If
  19.                         End If
  20.                         Namex.subitems(1).text = "online"
  21.                     Else
  22.                         If Namex.subitems(1).text = "offline" Then
  23.  
  24.                             If My.Settings.notify = True Then
  25.                                 NotifyIcon1.BalloonTipText = "player " & Namex.text & " has gone offline"
  26.                                 NotifyIcon1.ShowBalloonTip(2000)
  27.                             End If
  28.                         End If
  29.                         Namex.subitems(1).text = "offline"
  30.                         End If
  31.                 Next
  32.             Next
  33.         End If
  34.         ProgressBarX1.Value = 0

currently it gets the table from the web splits it and then scan each item against all the items from a list view.

when the person is found it says online and sends a notify message.
what currently happens is that it scans 1 name more then 1 time. so

webtable :
mmuziek
frank
peter

listview
mmuziek

now it returns first online
then it turns back offline 2 times because its not the same as frank and peter.
i hope you guys know what i mean

it must just check if it exists in the online list if not put it offline if true put it online

Viewing all articles
Browse latest Browse all 42215

Trending Articles



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