27/05/2020, 16:31
Log Dosyasından Listboxa nasıl Veri Alabiliriz
Public Sub readFromTxtFile()
Const conPATH_TO_FILE As String = "C:\Program Files\Medex.log"
Dim strLine As String
Dim varLineContents As Variant
Dim intCtr As Integer
Open conPATH_TO_FILE For Input As #1 'Open file.
Do While Not EOF(1) 'Loop until end of file.
Line Input #1, strLine 'Read line into variable.
varLineContents = Split(strLine, " ") 'Parse Line contents using a Space
'as the Delimiter
For intCtr = LBound(varLineContents) To UBound(varLineContents)
Debug.Print varLineContents(intCtr),
Next
'Debug.Print vbCrLf
Loop
Close #1 ' Close file.
End Sub