vb Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim files As New List(Of String)
Dim fbd As New FolderBrowserDialog
If fbd.ShowDialog = DialogResult.OK Then
files.AddRange(IO.Directory.GetFiles(fbd.SelectedPath, "*.php", IO.SearchOption.AllDirectories)) 'get all php files in selected folder
files.AddRange(IO.Directory.GetFiles(fbd.SelectedPath, "*.tpl", IO.SearchOption.AllDirectories)) 'get all tpl files in selected folder
'repeat for all file types
End If
MsgBox(files.Sum(Function(f) IO.File.ReadAllLines(f).Length))
'if you want to put all of the filenames in your listbox
listbox1.items.addrange(Array.ConvertAll(files.ToArray, Function(f) New IO.FileInfo(f)))
End Sub