Click here to Skip to main content
15,921,028 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I want to write a code in c# which can search the line and the file location and display it in form/console app. just like ctrl+shift+f in visual studio
Can any body provide a snippet regarding it
thanks in advance.
Posted
Updated 5-Jan-16 18:13pm
v2
Comments
Sergey Alexandrovich Kryukov 6-Jan-16 0:01am    
Nodes of some solution, project, or just files in some directories?
—SA
binadi007 6-Jan-16 0:19am    
Actually the solution (.sln file) which open, inside it all the files. Just like when I press ctrl+shift+f in visual studio and write some text and select "entire solution" and it shows all the files which containing that text. Same like that.
But not want to do such type of complicated thing.
Directly search whole text (Match Whole Word) and relating files display with the same text
Tomas Takac 6-Jan-16 2:47am    
My first question is why? You can do this in command line[^] or powershell[^]. If you really need to write it yourself then my next questions are: What have you tried? Where are you stuck? Where is your code?
binadi007 6-Jan-16 3:40am    
Why:- Coz I want to save the data into excel file. So I want some way to access it and save it into my required file......As I'm lazy to do it like copy-Paste
Right now nothing tried as such....but help is highly appreciable
Tomas Takac 6-Jan-16 4:03am    
What I mean is: why do you need to implement it yourself instead of using some existing tools? But if you really must implement it then have a look on Directory.EnumerateFiles method[^]. You need to open each file, read its content and search it.

1 solution

Hi,

There is not exact for it, but you can take the demo code from here.


[Search in Whole Solution]

Hope this will help you.
thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900