title: How To Load Text File Items To ListView VB .Net
body: <p>I have created ListView1 with 5 columns.
  Each column has different name and I need to 'load' from my PC by open dialog function and add text file in ListView1.
  The problem is that once I proceed and load txt file in ListView1, it doesnt reconize specific 'values' like "proxy" --> to 'Proxy column' "IP" --> to 'IP' column etc....
  I am adding formate from text file like this: 192.169.0.1:8080 and thats all I need to add only this 2 values in colmuns by tag name. The other column names are there because when I will check the proxies, It will display (speed, protocol and type)
  So here ismy code already:</p>
  
  <pre><code>Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      ListView1.View = View.Details
      ListView1.GridLines = True
      ListView1.FullRowSelect = True
      ListView1.HideSelection = False
      ListView1.MultiSelect = False
      ListView1.Columns.Add("IP", 90, HorizontalAlignment.Left)
      ListView1.Columns.Add("Port", 40, HorizontalAlignment.Left)
      ListView1.Columns.Add("Protocol", 80, HorizontalAlignment.Left)
      ListView1.Columns.Add("Type", 60, HorizontalAlignment.Left)
      ListView1.Columns.Add("Speed", 50, HorizontalAlignment.Left)
  End Sub
  
  Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
      OpenFileDialog1.ShowDialog()
      Dim filepath As String = OpenFileDialog1.FileName
      Dim inputstream As New IO.StreamReader(filepath)
      Dim newstr(2) As String
      Dim IP As String
      Dim Port As String
      Dim Protocol As String
      Dim Type As String
      Dim Speed As String
  
      'Read while there is mor characters to read
      Do While inputstream.Peek &lt;&gt; -1
          'Split each line containing Account|Password into the array
          newstr = inputstream.ReadLine().Split("|")
          'Assigm the values to the variables
          IP = newstr(0)
          Port = newstr(1)
          Protocol = newstr(2)
          Type = newstr(3)
          Speed = newstr(4)
  
          'Add them to the list
          Me.ListView1.Items.Add(IP)
          Me.ListView1.Items.Item(ListView1.Items.Count - 1).SubItems.Add(Port)
          Me.ListView1.Items.Item(ListView1.Items.Count - 1).SubItems.Add(Protocol)
          Me.ListView1.Items.Item(ListView1.Items.Count - 1).SubItems.Add(Type)
          Me.ListView1.Items.Item(ListView1.Items.Count - 1).SubItems.Add(Speed)
      Loop
  
      inputstream.Close()
  End Sub
  
  Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
      For Each Item As ListViewItem In ListView1.Items
          ListView1.Items.Remove(Item)
      Next
  End Sub
  </code></pre>
  
  <p>SO Could you someone tell me HOW TO ADD CODE to open dialog recognize my first 2 attributes values and add them to columns correctly? thx</p>