Thanks, that was the kind of code I`d come up with, I was hoping there was a
more elegant single line solution.
Rob
ps You need ReDim Preserve else the array is wiped every time
"gillardg" <gillardg*remove*@live.be> wrote in message
news:#(E-Mail Removed)...
> hi here is a one minute solution
>
>
> Dim files As String()
> Dim x As Integer = 0
> For Each str As String In My.Computer.FileSystem.GetFiles("c:\")
> ReDim files(x + 1)
> files(x) = str
> x = x + 1
> Next
>
>
> but maybe there is a better way to do that 
>
> "roidy" <(E-Mail Removed)> a écrit dans le message de groupe de discussion :
> IPo7m.810$(E-Mail Removed)2...
>> Hi, I`m trying to get the files in a directory using:-
>>
>> Dim files As String() = My.Computer.FileSystem.GetFiles("c:\")
>>
>> But get the following error:-
>>
>> Value of type 'System.Collections.ObjectModel.ReadOnlyCollection(Of
>> String)' cannot be converted to '1-dimensional array of String'
>>
>>
>> I need the files as an array of strings to pass to another function. So
>> my question is how to convert a read only collection of strings to an
>> array of strings
>>
>> Thanks
>> Rob
>>
>>