Click here to Skip to main content
15,916,527 members
Home / Discussions / C#
   

C#

 
GeneralGarbage Collection + threading question Pin
Radoslav Bielik16-Dec-02 12:27
Radoslav Bielik16-Dec-02 12:27 
GeneralRe: Garbage Collection + threading question Pin
Paul Ingles16-Dec-02 14:17
Paul Ingles16-Dec-02 14:17 
GeneralRe: Garbage Collection + threading question Pin
Jeff J16-Dec-02 20:42
Jeff J16-Dec-02 20:42 
GeneralRe: Garbage Collection + threading question Pin
Daniel Turini17-Dec-02 7:01
Daniel Turini17-Dec-02 7:01 
GeneralRe: Garbage Collection + threading question Pin
Radoslav Bielik18-Dec-02 6:46
Radoslav Bielik18-Dec-02 6:46 
GeneralProblems while developing an Explorer bar in C# Pin
Arun Bhalla16-Dec-02 12:16
Arun Bhalla16-Dec-02 12:16 
GeneralWin32 Search features Pin
David23g16-Dec-02 11:46
David23g16-Dec-02 11:46 
GeneralRe: Win32 Search features Pin
Jeff J16-Dec-02 19:26
Jeff J16-Dec-02 19:26 
I've done the sort of thing you're looking to do. In the Win32 API, you start with FindFirstFileEx(), FindNextFile(), and finally FindClose(), while walking the desired directory tree. That is exactly how the find/search applet in Windows does it, and it's very fast.

Once you have the desired file [by extension], just open it and search it. If the file is not too large, I recommend loading an entire buffer with the contents, then searching the whole thing. If the file is big, it's a little more complicated, because the beginning of the string to be found might lie at the end of one buffer full, and the end of it at the start of the next buffer full. Thus, you need to "overlap" the buffers, if you will, for at least the length of the string to search for. I did this with cyclic buffers, but there's no need to get fancy.

The CLR already wraps those Find* functions in the Directory class, with methods like GetFileSystemEntries() - the closest equivalent - and GetFiles(). Opening and searching the files is pretty much the same in .Net as in the Win32 API.

Cheers
GeneralListView Icon Selection Pin
Jonathan Austin16-Dec-02 11:04
Jonathan Austin16-Dec-02 11:04 
GeneralRe: ListView Icon Selection Pin
Jonathan Austin16-Dec-02 11:21
Jonathan Austin16-Dec-02 11:21 
GeneralRe: ListView Icon Selection (I butchered it) Pin
Jonathan Austin16-Dec-02 12:25
Jonathan Austin16-Dec-02 12:25 
GeneralRe: ListView Icon Selection (I butchered it) Pin
Jeff J16-Dec-02 19:03
Jeff J16-Dec-02 19:03 
GeneralRe: ListView Icon Selection (I butchered it) Pin
Jonathan Austin17-Dec-02 8:08
Jonathan Austin17-Dec-02 8:08 
Generalquestion on string and encryption sorta Pin
jtmtv1816-Dec-02 9:51
jtmtv1816-Dec-02 9:51 
GeneralRe: question on string and encryption sorta Pin
jtmtv1816-Dec-02 10:45
jtmtv1816-Dec-02 10:45 
GeneralRe: question on string and encryption sorta Pin
Rob Graham16-Dec-02 11:15
Rob Graham16-Dec-02 11:15 
Questionhelp require? Pin
imran_rafique16-Dec-02 6:49
imran_rafique16-Dec-02 6:49 
AnswerRe: help require? Pin
Andres Manggini16-Dec-02 12:13
Andres Manggini16-Dec-02 12:13 
GeneralRe: help require? Pin
imran_rafique16-Dec-02 12:36
imran_rafique16-Dec-02 12:36 
GeneralWindows Form Control hosted in IE Pin
LJMorsillo16-Dec-02 4:34
LJMorsillo16-Dec-02 4:34 
Questionxor strings?? Pin
Karavaev Denis15-Dec-02 23:52
Karavaev Denis15-Dec-02 23:52 
AnswerRe: xor strings?? Pin
Kannan Kalyanaraman16-Dec-02 0:13
Kannan Kalyanaraman16-Dec-02 0:13 
GeneralRe: xor strings?? Pin
Karavaev Denis16-Dec-02 0:46
Karavaev Denis16-Dec-02 0:46 
GeneralRe: xor strings?? Pin
Christian Graus16-Dec-02 0:54
protectorChristian Graus16-Dec-02 0:54 
GeneralRe: xor strings?? Pin
Karavaev Denis16-Dec-02 1:06
Karavaev Denis16-Dec-02 1:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.