PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms GetFiles from directory and all subdirectories.

Reply

GetFiles from directory and all subdirectories.

 
Thread Tools Rate Thread
Old 01-06-2005, 06:49 PM   #1
=?Utf-8?B?U3R1ZGVudA==?=
Guest
 
Posts: n/a
Default GetFiles from directory and all subdirectories.


Hi,

I am trying to write a small program in VB.NET which needs to get all the
filenames (paths) in all

subdirectories.

I want just be able to specify a top level directory e.g. "c:\images" -
which may have several

subdirectories and go down to a number levels with subdirectories within them.

Here's what I have done so far but this just gets the filenames and
directories in the c:\images but

doesn't get filename from directories within here.

imports system.io
dim folder as filesysteminfo
dim files() as string

files = folder.getfilesystementries("c:\images")


Any help will be very much appreciated. Many thanks
  Reply With Quote
Old 01-06-2005, 07:06 PM   #2
=?Utf-8?B?S3VuYWwgQ2hlZGE=?=
Guest
 
Posts: n/a
Default RE: GetFiles from directory and all subdirectories.

Hi,

read at the MS Lin
http://msdn.microsoft.com/library/d...oclasstopic.asp

also you need to see
1.
http://msdn.microsoft.com/library/d...toriestopic.asp

2.
http://msdn.microsoft.com/library/d...minfostopic.asp


With Regards,
Kunal Cheda.
http://www.KCheda.com


"Student" wrote:

> Hi,
>
> I am trying to write a small program in VB.NET which needs to get all the
> filenames (paths) in all
>
> subdirectories.
>
> I want just be able to specify a top level directory e.g. "c:\images" -
> which may have several
>
> subdirectories and go down to a number levels with subdirectories within them.
>
> Here's what I have done so far but this just gets the filenames and
> directories in the c:\images but
>
> doesn't get filename from directories within here.
>
> imports system.io
> dim folder as filesysteminfo
> dim files() as string
>
> files = folder.getfilesystementries("c:\images")
>
>
> Any help will be very much appreciated. Many thanks

  Reply With Quote
Old 01-06-2005, 08:15 PM   #3
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
Default Re: GetFiles from directory and all subdirectories.

"Student" <Student@discussions.microsoft.com> schrieb:
> I am trying to write a small program in VB.NET which needs to get all the
> filenames (paths) in all subdirectories.


<URL:http://dotnet.mvps.org/dotnet/samples/filesystem/FileSystemEnumerator.zip>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off