Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
16k views
in .NET FTP by (320 points)
Does anyone know how to capture the logging info coming from the FTP server? I can see it in the debug window in Visual Studio, but do not know how to capture it. I would like to post it to a listbox in my program.

11 Answers

0 votes
by (162k points)
Looks ok. What is the exception and where is it thrown?

So I pass the StringWriter constructor a MemoryStream, but how can i now read from it? I keep getting an exception thrown. here is my code...

private System.IO.StreamWriter logWriter;
private System.IO.StreamReader logReader;
private System.IO.MemoryStream memStream;

MemoryStream memStream = new MemoryStream();
this.logWriter = new StreamWriter(memStream);
this.logReader = new StreamReader(memStream);

private void logIt()
{
logBox.Text = FromASCIIByteArray(memStream.ToArray());

}

public static string FromASCIIByteArray(byte[] characters)
{
ASCIIEncoding encoding = new ASCIIEncoding( );
string constructedString = encoding.GetString(characters);

return (constructedString);
}

Categories

...