Imports System.IO
Dim path As String = ""
path = "C:\Users\Josh\Desktop\config.txt"
Using fo As New OpenFileDialog fo.RestoreDirectory = True fo.Filter = "Text Files | *.txt" fo.FilterIndex = 1 fo.MultiSelect = False fo.ShowDialog() If Not (fo.FileName = Nothing) Then path = fo.FileName End Using
Dim lines As New List(Of String) Using sr As New StreamReader(path) While (sr.peek <> -1) lines.add(sr.readline()) End While End Using
Private Function getProperty(ByVal prop As String, ByVal list As List(Of String)) For Each item As String In list If (item.Split(":")(0) = prop) Then Return item.Split(":")(1) Next Return "" End Function
MsgBox(getProperty("Name", list))