473,395 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

List of Files from URL Directory using VB

MS
I am looking to get a list of files for a URL reference such as
http://localhost/manager/ for a certain search pattern say "*.xls". How do I
go about this using VB and what class libraries are best to use. If anyone
has any code or can redirect me to a better site then that would be great.
Thanks in advance.
Jan 15 '07 #1
3 5271
First you need to map the virtual path to the physical one. Do this with the
page's MapPath method.

Second, have a look into System.IO namespace. You will find plenty of
classes to operate on directories and files.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"MS" <ms@ms.comwrote in message
news:eq**************@TK2MSFTNGP03.phx.gbl...
>I am looking to get a list of files for a URL reference such as
http://localhost/manager/ for a certain search pattern say "*.xls". How do
I go about this using VB and what class libraries are best to use. If
anyone has any code or can redirect me to a better site then that would be
great.
Thanks in advance.


Jan 15 '07 #2
On Mon, 15 Jan 2007 10:06:31 -0000, MS wrote:
I am looking to get a list of files for a URL reference such as
http://localhost/manager/ for a certain search pattern say "*.xls". How do I
go about this using VB and what class libraries are best to use. If anyone
has any code or can redirect me to a better site then that would be great.
Thanks in advance.
System.IO is your friend.

Once you have imported it you can do this:
'Get the physical path of the root
Dim folder As String = Page.MapPath("~")
'Get a string array of all excel files
Dim dirs As String() = Directory.GetFiles(folder, "*.xls")

--
Bits.Bytes
http://bytes.thinkersroom.com
Jan 15 '07 #3
MS
Thanks all. I will try.

"Rad [Visual C# MVP]" <no****@nospam.comwrote in message
news:1g****************@thinkersroom.com...
On Mon, 15 Jan 2007 10:06:31 -0000, MS wrote:
>I am looking to get a list of files for a URL reference such as
http://localhost/manager/ for a certain search pattern say "*.xls". How
do I
go about this using VB and what class libraries are best to use. If
anyone
has any code or can redirect me to a better site then that would be
great.
Thanks in advance.

System.IO is your friend.

Once you have imported it you can do this:
'Get the physical path of the root
Dim folder As String = Page.MapPath("~")
'Get a string array of all excel files
Dim dirs As String() = Directory.GetFiles(folder, "*.xls")

--
Bits.Bytes
http://bytes.thinkersroom.com

Jan 18 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: RML | last post by:
hey guys, i am looking at this piece of code that lists numbers of files in a directory. i want to convert it so it lists the files in th directory that end with .doc. i cant seem to get it to...
11
by: Madison Kelly | last post by:
Hi all, I am new to the list and I didn't want to seem rude at all so I wanted to ask if this was okay first. I have a program I have written in perl which uses a postgresSQL database as the...
6
by: tgnelson85 | last post by:
Hello, C question here (running on Linux, though there should be no platform specific code). After reading through a few examples, and following one in a book, for linked lists i thought i would...
3
by: froditus | last post by:
Hello everyone, is it possible to list files from directory other than in apache web directory? my web folder is placed on c:/ and i put my files in windows directory "d:/files/images/". I...
1
by: dorandoran | last post by:
I created an MSI package and it works great. However, the source code aren't compiled. They show up row in the test web server. This is No No in our environment. Are there any steps that I am missing...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.