Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 18th, 2006, 2:12 PM   #1
Twilight
Programmer
 
Join Date: Apr 2006
Location: Calgary, Alberta
Posts: 67
Rep Power: 3 Twilight is on a distinguished road
Basic File Search Program

I was wondering it, given a windows directory, there is a function to read all the names of files in that directory. Essentially what I want to do is have a program search for strings within file name, so I just need to read the program name into the program.

And would such a thing be easier in C++ or C#?
Twilight is offline   Reply With Quote
Old May 18th, 2006, 2:31 PM   #2
MBirchmeier
Hobbyist Programmer
 
Join Date: Oct 2005
Posts: 211
Rep Power: 4 MBirchmeier is on a distinguished road
Quote:
Originally Posted by Twilight
I was wondering it, given a windows directory, there is a function to read all the names of files in that directory. Essentially what I want to do is have a program search for strings within file name, so I just need to read the program name into the program.

And would such a thing be easier in C++ or C#?
what's wrong with

dir /s /b *<searchString>*

-MBirchmeier
MBirchmeier is offline   Reply With Quote
Old May 18th, 2006, 2:47 PM   #3
King
Professional Programmer
 
King's Avatar
 
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 380
Rep Power: 3 King is on a distinguished road
Quote:
Originally Posted by Twilight
I was wondering it, given a windows directory, there is a function to read all the names of files in that directory. Essentially what I want to do is have a program search for strings within file name, so I just need to read the program name into the program.

And would such a thing be easier in C++ or C#?
yea it is possible. Use the language you know better.
__________________
I am Addicted to Linux!
King is offline   Reply With Quote
Old May 18th, 2006, 4:32 PM   #4
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
C# would be easier...

C++ would be better for the knowledge
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old May 18th, 2006, 4:36 PM   #5
Cache
Hobbyist
 
Join Date: Sep 2005
Posts: 266
Rep Power: 4 Cache is on a distinguished road
MSDN example: http://msdn.microsoft.com/library/de..._directory.asp

You can also navigate the shell namespace through COM.
Cache is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:15 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC