all groups > dotnet windows forms > february 2007 >
You're in the

dotnet windows forms

group:

Syntax to get filename list from Multi-select Open file Dialog


Syntax to get filename list from Multi-select Open file Dialog ElmoWatson
2/26/2007 5:29:05 PM
dotnet windows forms:
I need to get the list of files, in a multi-select OpenFileDialog,
formatting the list for my purposes (adding to an array)

I can't seem to grasp the syntax - - here's part of what I've tried, after
creating two variables (s and sList):
Dim sList as String() '< - array I want to use

Dim ofd As New OpenFileDialog
For Each s In ofd.FileNames
' what do I put here to add the item in the array?
Next

or, is it an array anyway? If so, I do I access it?

I just need to pass an existing array to another method, using the filenames
in the OFD

Re: Syntax to get filename list from Multi-select Open file Dialog Patrick Steele
2/26/2007 8:26:20 PM
In article <#4sOn3fWHHA.896@TK2MSFTNGP05.phx.gbl>, bilboB@yahoo.com
says...
[quoted text, click to view]

Yes, the Filenames property is already a string array.

[quoted text, click to view]

You can use For/Each like you're doing in your sample.

--
Patrick Steele
AddThis Social Bookmark Button