Visual Studio 2005 As General Code Search Tool

Visual Studio 2005 has powerful search capabilities. One of my favorites is "Find in Files".

image

 

 

Just hit Ctrl+Shift+F (more shortcuts - My Favorite Shortcuts).

Essentially it uses FindStr utility that sits in System32 folder and comes for free with Windows OS. FindStr is a command line utility and those who like typing would prefer it, but those who like UI would go for Visual Studio. There is no need to open project - just fire up Visual Studio and hit Ctrl+Shift+F.

I discussed different searching options I practice here - Security Code Inspection - Eternal Search For SQL Injection , but I thought FindStr and its utilization in Visual Studio deserves special attention.

The best part I like is that after hitting "Find All" button I am presented with list of all files that matched the search criteria and the match itself, so I can quickly evaluate what I got in my net. Once I smell something fishy I hit the file and it opens in the very same Visual Studio for detailed inspection. I think it is very handy.

 

 Enjoy.

Published 05 June 07 10:50 by alikl

Comments

# daniel said on June 6, 2007 2:00 AM:

Search (& replace) in vs2005 is the bomb, as a programmer that's one leg in Microsoft space and one leg outside, I'm keeping VS opened all day for uses such as this.

VS has another advantage, and that's in opening and handling HUGE text files.

Cheers,

Daniel.

# alikl said on June 6, 2007 3:03 AM:

"The Bomb" - i guess is good in this context :).

All credits go to FindStr utility - Visual Studio is just fancy UI w/r to search in files capability.

# BEM said on June 7, 2007 3:51 AM:

I have been using VS all day long for years, and I did not know this.  Great tip!

# alikl said on June 7, 2007 4:02 AM:

BEM, Happy it was helpful for you!!

Have you sen what ILDASM, FindStr, and Outlook can do for you w/r to search?

Check out "Security .Net Code Inspection Using Outlook 2007" link under Popular on the side bar

Enjoy

:)

# alik levin's said on January 24, 2008 8:38 AM:

How to streamline the process of capturing security flaws during security code review? How to save time

# alik levin's said on March 17, 2008 10:56 AM:

Want to quickly check your ASP.NET Web application for Cross Site Scripting (XSS) vulnerability ? It

# ACE Team - Security, Performance & Privacy said on July 24, 2008 4:17 PM:

"The hardest thing of all is to find a black cat in a dark room, especially if there is no cat."

New Comments to this post are disabled

Search

This Blog

. My Personal Blog .

.Net Performance How To's

.Net Security How To's

Design Patterns

Impactful

Lifecycle Phases

Popular

Tools

Syndication

Page view tracker