DirectoryListing throwing NullReference exception for no reason

Giganews Newsgroups
Subject: DirectoryListing throwing NullReference exception for no reason
Posted by:  Aditya Gaddam (adityagadd…@gmail.com)
Date: Sun, 15 May 2005

Hi,

I am pretty sure I am doing this right. I have connected to a server and
one method using List() and StringCollection lists the folders/files in
a directory fine. But when I try to do anything with DirectoryList, it
keeps throwing a runtime NullReference exception.

The server I am trying to connect to is a "PureFTPd" server. Pretty sure
it's atleast simulating unix FTP servers.

I am not even trying to get the list of items, just the count. For
example, the following:

MainForm.Debug(m_Ftp.DirectoryListing.Count.ToString());

throws the nullreference exception. MainForm.Debug definitely works, I
am using it all over my application (it's my own little functions). So I
am sort of lost here. Any help is appreciated.

Cheers,
Aditya

Replies