Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get anything after LIST command in FTP client. #1

Open
HerbZhu opened this issue Feb 11, 2014 · 0 comments
Open

Cannot get anything after LIST command in FTP client. #1

HerbZhu opened this issue Feb 11, 2014 · 0 comments

Comments

@HerbZhu
Copy link

HerbZhu commented Feb 11, 2014

Just write an FTP Client with FtpWebRequest, but can not read anything after using the command WebRequestMethods.Ftp.ListDirectoryDetails.

////////////////////////////////////////////////////////////////////////////////////////
// Code in the FTP client
List List(string uri)
{
FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(uri);
request.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
FtpWebResponse response = request.GetResponse();
Stream responseStream = response.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream);
string strList = streamReader.ReadToEnd();
// here, strList always is empty, i.e., "".
....
}
////////////////////////////////////////////////////////////////////////////////////////

I have reset the user.xml to a valid folder with some files. In debug mode, I saw FtpClientConnection.ListOperation was executed "correctly" (I mean I saw dataWriter.Write() was called with correct number of times matching with the number of files in homeDir).

Any clue? Thanks!

I am with VisualStudio 2010.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant