17-08-13, 05:03 PM
PHP كود :
If TextBox1.Lines.Length > 0 Then
Me.ListView1.Items.Clear()
For Each line As String In TextBox1.Lines
Dim whole As String = line
Dim firstpart As String = whole.Substring(0, whole.LastIndexOf(","))
Dim lastpart As String = whole.Substring(whole.LastIndexOf(",") + 1)
Try
Application.DoEvents()
If lastpart = "0" Then
Dim LVI As New ListViewItem("PC " & firstpart)
LVI.ToolTipText = "Status : Opened"
LVI.ImageKey = "ScreenOpend"
Me.ListView1.Items.Add(LVI)
Else
Dim LVI As New ListViewItem("PC " & firstpart)
LVI.ToolTipText = "Status : Closed"
LVI.ImageKey = "ScreenClosed"
Me.ListView1.Items.Add(LVI)
End If
Catch ex As Exception
Dim LVI As New ListViewItem("PC " & ex.Message)
LVI.ToolTipText = "Status : Closed"
LVI.ImageKey = "ScreenClosed"
Me.ListView1.Items.Add(LVI)
End Try
Application.DoEvents()
Next
End If
End Sub
