473,513 Members | 2,263 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filelist -> Droplist?

Hello

I was wondering if you guys could show me how to fill a droplist with files
from a directory?

I got this but dont work

DirectoryInfo dir = new DirectoryInfo(Server.MapPath("img/"));

DropDown1.DataSource = dir.GetFiles(dir);

DropDown1.DataBind();




Nov 18 '05 #1
1 1371
Hi Edsvik,
make DataSource = dir.GetFiles() instead of dir.GetFiles(dir) and see that
the img folder has some files.

DirectoryInfo dir = new DirectoryInfo(Server.MapPath("img/"));
DropDown1.DataSource = dir.GetFiles();
DropDown1.DataBind();

HTH
srini
"Lasse Edsvik" wrote:
Hello

I was wondering if you guys could show me how to fill a droplist with files
from a directory?

I got this but dont work

Nov 18 '05 #2

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

Similar topics

2
2362
by: Christian-Josef Schrattenthaler | last post by:
Hi! I want to build a PHP-Site, wich lists some downloadable files in some directories from our internet server. Can anyone tell me some hints, to build such a page? It would also be fine,...
6
8177
by: RudyL | last post by:
OK, I'm stumped. I'm trying to rename all the files displayed inside of a filelist box. VB help just doesn't help - I'm using VB6 Thanks
24
7251
by: Joerg Schuster | last post by:
Hello, I am looking for a method to "shuffle" the lines of a large file. I have a corpus of sorted and "uniqed" English sentences that has been produced with (1): (1) sort corpus | uniq >...
10
5459
by: Fabio | last post by:
Hi everyone, Is there anybody who can suggest me a link where I can find information about 'Persistent linked list' ? I need to implement a linked list where every node is a structure like the...
1
5165
by: Grant Hammond | last post by:
I have a callback function that populates a listbox with a list of file names in a folder. This code came from Terry Kreft/Dev Ashish some years ago. I now want to add another column to the list...
1
1270
by: Lasse Edsvik | last post by:
Hello Is it possible to return a list of files from a function? private ??? test() { DirectoryInfo dir = new DirectoryInfo(Server.MapPath("img/"));
4
2093
by: hzgt9b | last post by:
Using VB .NET 2003, I have a windows application that performs a series of file actions (copy, move, delete) but the actions are completing before the window is painted on the screen... how can I...
16
3224
by: matt | last post by:
I have used some free code for listing files for download, but I want to send an email to the administrator when the file has been downloaded. I have got some code in here that does it, but it will...
37
5742
by: Soccerplayer1316 | last post by:
Would anyone know how to write a program in python that takes a directory (source) and backs up that directory into another directory (target directory)? I've been trying to work on it, but I have...
5
3338
by: xiaoboren | last post by:
Hi, Thank you for read my problem. My problem: I have a folder which contains some .txt files, I want to read all of these files and write the data of these files into a new file. Thanks...
0
7265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7171
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
7388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7547
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...
1
7114
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
5693
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,...
1
5098
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4751
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
461
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.