Imports System.IO
Public Class Form1
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim objStreamReader As StreamReader
Dim strLine As String
'Pass the file path and the file name to the StreamReader constructor.
objStreamReader = New StreamReader("C:\test.txt")
'Read the first line of text.
strLine = objStreamReader.ReadLine
'Continue to read until you reach the end of the file.
Do While Not strLine Is Nothing
'Write the line to the ComboBox.
ComboBox1.Items.Add(strLine)
'Read the next line.
strLine = objStreamReader.ReadLine
Loop
'Close the file.
objStreamReader.Close()
End Sub
End Class
Imports System.IO
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objStreamReader As New StreamReader("C:\test.txt")
Do While objStreamReader.Peek <> -1
'Read the line to the ComboBox.
ComboBox1.Items.Add(objStreamReader.ReadLine())
Loop
objStreamReader.Close()
End Sub
End Class
Imports System.IO
Imports System.NullReferenceException
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objStreamReader As New StreamReader("C:\test.txt")
Do While objStreamReader.Peek <> -1
'Read the line to the ComboBox.
ComboBox1.Items.Add(objStreamReader.ReadLine())
Loop
objStreamReader.Close()
Dim objStreamReader2 As New StreamReader("C:\address.txt")
Dim ADDRESS As New ArrayList()
Dim x As Integer
Do While objStreamReader2.Peek <> -1
'Read Addresses into the ArrayList.
ADDRESS.Add(objStreamReader2.ReadLine())
Loop
objStreamReader2.Close()
'need to put the selectedindex here?
Process.Start(something here)
End Sub
End Class