You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: