D
Darrel
I'm trying to grab the files in a directory and add each one to an array
list. Thist is what I have:
1 Dim filesToUpload() As ArrayList
2 Dim batchFiles As String() =
System.IO.Directory.GetFiles(Server.MapPath("/batchupload/"))
3 Dim arrayCount As Integer = 0
4 For Each fileName As String In batchFiles
5 filesToUpload(arrayCount).Add(fileName)
6 arrayCount = arrayCount + 1
7 Next
But it's giving me an 'Object reference not set to an instance of an
object.' error on line 5. This is code from a tutorial (though modified to
use an arrayList rather than rediming an array) so I'm assuming I goofed up
my syntax somewhere.
-Darrel
list. Thist is what I have:
1 Dim filesToUpload() As ArrayList
2 Dim batchFiles As String() =
System.IO.Directory.GetFiles(Server.MapPath("/batchupload/"))
3 Dim arrayCount As Integer = 0
4 For Each fileName As String In batchFiles
5 filesToUpload(arrayCount).Add(fileName)
6 arrayCount = arrayCount + 1
7 Next
But it's giving me an 'Object reference not set to an instance of an
object.' error on line 5. This is code from a tutorial (though modified to
use an arrayList rather than rediming an array) so I'm assuming I goofed up
my syntax somewhere.
-Darrel