I am trying to (programatically) find references to a specific string i.e. ‘LOCK_ID’ within a large number of VB6 files. To help people navigate directly to the reference I would also like to retrieve the line number of the match. i.e:
- Search all VB6 files for reference
- If a reference was found I would like to retrieve the line number on which the reference was located.
Short of opening every file in the directories and iterating through the file and keeping count of which line I am examining for the search term, is there a quicker/easier way of achieving this?
Here are the functions I used to achieve the desired functionality:
Helper class: