Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. Private _TextFound As Boolean = False
  2. Private Sub Button10_Click(sender As System.Object, e As System.EventArgs) Handles Button10.Click
  3. FindTheText("C:tempInHere", "cheese")
  4. MessageBox.Show(_TextFound)
  5. End Sub
  6.  
  7. Private Sub FindTheText(sDirToLookIn As String, sTextToFind As String)
  8. If IO.Directory.Exists(sDirToLookIn) Then
  9. Dim di As New IO.DirectoryInfo(sDirToLookIn)
  10. For Each dii As IO.DirectoryInfo In di.GetDirectories
  11. FindTheText(dii.FullName, sTextToFind)
  12. Next
  13. If IO.File.Exists(sDirToLookIn & "SomeFile.html") Then
  14. If IO.File.OpenText(sDirToLookIn & "SomeFile.html").ReadToEnd.Contains(sTextToFind) Then
  15. _TextFound = True
  16. End If
  17. End If
  18. End If
  19. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement