Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 13th, 2004, 03:52 PM
Registered User
Join Date: Aug 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default get a collection of filenames/paths from a dir?

DirectoryInfo directory = new DirectoryInfo(@"c:\");
FileInfo[] fileArray = directory.GetFiles("*.deck");

using that, I now have an array of FileInfo objects for the files I want to look at.

but here's what I want to do:

I want to have a listbox form control that displays a list of the NAMES (just the filename without the extention .deck) *.deck files from a particular directory. and I want to load a deck file when it is doubleclicked in the listbox.

so I'm thinking I should create a collection of objects that each just have the correctly formatted Name and the Path to use for loading. I can't figure out how to do that though...and I'm not sure that's the best way anyway.

how would you recommend I go about doing my listbox? is there by chance a built-in class that would help me?

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to handle corrupt filenames jwhvng Excel VBA 0 November 2nd, 2006 06:28 PM
Filenames/Database Comparison scubasteve Access 7 July 16th, 2006 02:39 AM
Fetching filenames from a folder shazia1 VS.NET 2002/2003 1 January 26th, 2006 06:29 PM
bulk insert files with different filenames fgeorge SQL Server DTS 1 May 25th, 2004 09:03 AM
bulk insert files with different filenames fgeorge SQL Server 2000 1 May 25th, 2004 08:59 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.