I am trying to create a Public Class which takes a folder address and
displays a list of files/folders within that folder.
I am struggling with a Sub which I'm calling List which I intend to use to
retrieve a list of the files in a given address and bind the results of
that (the list of files) to a DataList.
The code for the Sub is as follows:
.....
Public Sub List()
Dim dirInfo As New DirectoryInfo(_address)
Dim aFiles as FileInfo() = dirInfo.GetFiles ("*.*")
dlDataList.DataSource = aFiles
dlDataList.DataBind()
End Sub
......
However, this throws up an error message as follows:
......
BC30469: This reference to a non-shared member requires an object
reference, and none is supplied.
......
I'm new to ASP.NET and am just trying to get my head around the way it
works so any help with this would be much appreciated!
Regards
Jon Hilton