Counting files in directory

D

David C

I have an ASP.Net web site that does some file system folder access. One of
the things I am doing is counting the # of files in a passed directory to
determine if I show or hide something on the page. My problem is that I
want to ignore hidden files in the count but I can't find a way to do this.
Below is my code. Can someone let me know if this is possible and how to do
it? Thanks.

David

Public Shared Function FilesInPath(ByVal strPhyPath As String) As Integer

Dim intFiles As Integer = My.Computer.FileSystem.GetFiles(strPhyPath).Count

FilesInPath = intFiles

End Function
 
C

Cowboy \(Gregory A. Beamer\)

to figure out hidden versus non-hidden files, you have to look at the
attributes of each file, which means you will have to loop through all files
in the directory to examine them.
 
D

David C

I was afraid of that. It would be nice to have something like the
"wildcard" in file search to look for attributes. Thanks.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top