G
Guest
I'm writing a small FTP client to include in one of my programs but I'm not
sure how to get a binary stream using the TCPStream. This is my code at the
moment...
responseConnection = new TcpClient(responseIP, responsePort);
responseStream = responseConnection.GetStream();
responseReader = new StreamReader(responseStream);
StreamWriter fileStream = new StreamWriter(@"C:\" +
lstFTPView.SelectedItems[0].Text, false);
do
{
output = responseReader.ReadLine();
if (output != null)
{
fileStream.WriteLine(output);
} while(output != null);
The problem with the above is that it reams the stream text but this wont
work with binary files. How can I get around this?
Thanks,
Darrell
sure how to get a binary stream using the TCPStream. This is my code at the
moment...
responseConnection = new TcpClient(responseIP, responsePort);
responseStream = responseConnection.GetStream();
responseReader = new StreamReader(responseStream);
StreamWriter fileStream = new StreamWriter(@"C:\" +
lstFTPView.SelectedItems[0].Text, false);
do
{
output = responseReader.ReadLine();
if (output != null)
{
fileStream.WriteLine(output);
} while(output != null);
The problem with the above is that it reams the stream text but this wont
work with binary files. How can I get around this?
Thanks,
Darrell