Click here to Skip to main content
15,898,732 members
Home / Discussions / C#
   

C#

 
GeneralRe: Icons Pin
jtmtv1816-Jan-03 9:40
jtmtv1816-Jan-03 9:40 
GeneralRe: Icons Pin
leppie16-Jan-03 11:08
leppie16-Jan-03 11:08 
Generalsend mail Pin
Dorina14-Jan-03 21:13
Dorina14-Jan-03 21:13 
Generalapplication flashing in taskbar Pin
fredza14-Jan-03 20:43
fredza14-Jan-03 20:43 
GeneralRe: application flashing in taskbar Pin
SimonS14-Jan-03 22:21
SimonS14-Jan-03 22:21 
QuestionIdle event? Pin
kman14-Jan-03 12:34
kman14-Jan-03 12:34 
Generalaccessing selected text in a foreground window Pin
Gene Yu14-Jan-03 9:37
Gene Yu14-Jan-03 9:37 
GeneralDirectory Drilling/Recursion Pin
MrEyes14-Jan-03 7:57
MrEyes14-Jan-03 7:57 
I am attempting to create a piece of code that will drop through from a root directory and list all files and subdirectories within it (regardless of the directory depth)

As I see it the only way I can do this is through some sort of recursive code, which at the moment elludes me, has anybody come across anything like this before?

At the moment I have the following, which is butt-ugly and doesnt come close to what I need :
<br />
public string ARCHIVE_PATH = ".\\archive\\";<br />
private void RecurseDirectories()<br />
{<br />
 listBox1.Items.Clear();<br />
 DirectoryInfo dir = new DirectoryInfo(ARCHIVE_PATH);<br />
 DirectoryInfo[] diArr = dir.GetDirectories();<br />
 foreach (DirectoryInfo dri in diArr)<br />
 {<br />
  listBox1.Items.Add(dri.Name);<br />
  DirectoryInfo drill_dir = new DirectoryInfo(ARCHIVE_PATH + dri.Name);<br />
  DirectoryInfo[] drill_diArr = drill_dir.GetDirectories();<br />
<br />
  foreach (DirectoryInfo drill_dri in drill_diArr)<br />
  {<br />
   listBox1.Items.Add(drill_dri.Name);<br />
  }<br />
 }		<br />
}

GeneralRe: Directory Drilling/Recursion Pin
Hesham Amin14-Jan-03 9:12
Hesham Amin14-Jan-03 9:12 
GeneralRe: Directory Drilling/Recursion Pin
leppie14-Jan-03 9:51
leppie14-Jan-03 9:51 
Generalcompilation date / time in c# Pin
mleonhartsberger14-Jan-03 7:27
mleonhartsberger14-Jan-03 7:27 
GeneralRe: compilation date / time in c# Pin
Paul Ingles14-Jan-03 7:29
Paul Ingles14-Jan-03 7:29 
GeneralRe: compilation date / time in c# Pin
mleonhartsberger14-Jan-03 7:38
mleonhartsberger14-Jan-03 7:38 
GeneralRe: compilation date / time in c# Pin
Paul Ingles14-Jan-03 10:49
Paul Ingles14-Jan-03 10:49 
GeneralRe: compilation date / time in c# Pin
James T. Johnson14-Jan-03 8:31
James T. Johnson14-Jan-03 8:31 
GeneralRe: compilation date / time in c# Pin
David Stone14-Jan-03 17:42
sitebuilderDavid Stone14-Jan-03 17:42 
GeneralDeploying a dot NET app Pin
antoine@orchus-tech14-Jan-03 5:10
antoine@orchus-tech14-Jan-03 5:10 
GeneralRe: Deploying a dot NET app Pin
Stephane Rodriguez.14-Jan-03 5:37
Stephane Rodriguez.14-Jan-03 5:37 
GeneralRe: Deploying a dot NET app Pin
Stephane Rodriguez.16-Jan-03 2:41
Stephane Rodriguez.16-Jan-03 2:41 
QuestionNetworkStream? Pin
gekoscan13-Jan-03 19:59
gekoscan13-Jan-03 19:59 
QuestionRuntime Compilation - Worth It? Pin
Eric Astor13-Jan-03 15:14
Eric Astor13-Jan-03 15:14 
AnswerRe: Runtime Compilation - Worth It? Pin
Frank Hileman8-Apr-03 10:23
Frank Hileman8-Apr-03 10:23 
GeneralRe: Runtime Compilation - Worth It? Pin
Eric Astor8-Apr-03 11:41
Eric Astor8-Apr-03 11:41 
GeneralRe: Runtime Compilation - Worth It? Pin
Frank Hileman10-Apr-03 6:06
Frank Hileman10-Apr-03 6:06 
GeneralRe: Runtime Compilation - Worth It? Pin
Eric Astor10-Apr-03 6:51
Eric Astor10-Apr-03 6:51 

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.