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