To get the number of files in a folder, use the following:
Dim filecount as Integer =
System.IO.Direc tory.GetFiles(S erver.MapPath(" ./")).Length( )
This code gets the number of files in the current directory. Server.MapPath
takes one parameter which is a String that is the relative path to the
desired directory and returns the complete path on the server. To get the
number of files in a different directory, simply change the parameter to
something like:
Dim filecount as Integer =
System.IO.Direc tory.GetFiles(S erver.MapPath(" myfiles/")).Length( )
Because the parameter is a relative path, you can also use "../" to go up
one directory. If you have any questions, feel free to ask or see the
documentation. Good Luck!
--
Nathan Sokalski
nj********@hotm ail.com http://www.nathansokalski.com/
"sasikumar" <sa*********@gm ail.com> wrote in message
news:11******** *************@c 74g2000cwc.goog legroups.com...
i have created a new folder inside project(say update for storing
update files for software)
how can i get total number of files in that folder.what will be full
path for accessing that folder.(path compatibile for use in system.io)