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.
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
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:
Dim returnValue As String = html Dim usernames As String() = returnValue.Split("|") If returnValue = "" Then MsgBox("error cannot pull players please check data and make sure the server has querry enabled") Else For Each Namex In ListViewEx2.Items For Each username In usernames username = username.Trim If Namex.text = username Then If Namex.subitems(1).text = "offline" Then If My.Settings.notify = True Then NotifyIcon1.BalloonTipText = "player " & Namex.text & " is now online!" NotifyIcon1.ShowBalloonTip(2000) End If End If Namex.subitems(1).text = "online" Else If Namex.subitems(1).text = "offline" Then If My.Settings.notify = True Then NotifyIcon1.BalloonTipText = "player " & Namex.text & " has gone offline" NotifyIcon1.ShowBalloonTip(2000) End If End If Namex.subitems(1).text = "offline" End If Next Next End If 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