muro
Active member
- Joined
- Apr 30, 2018
- Messages
- 26
- Programming Experience
- 3-5
Dear friends,
i have got this code where the Streamreader sometimes reads the file fine and sometimes skips a few lines and i have absoloutely no idea why it is doing this.
i have got this code where the Streamreader sometimes reads the file fine and sometimes skips a few lines and i have absoloutely no idea why it is doing this.
C#:
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://myfile.txt");
request.Method = WebRequestMethods.Ftp.DownloadFile;
request.Credentials = new NetworkCredential("user, "pw");
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
Stream responseStream = response.GetResponseStream();
StreamReader reader = new StreamReader(responseStream);
while (!reader.EndOfStream)
{
MessageBox.Show(reader.ReadLine());
}
response.Close();
reader.Close();