OnStatus Event C#

This forum is not monitored by the SmartFTP staff. If you have a license please contact technical support by email.
Post Reply
avsomeren
Posts: 5
Joined: Wed Jun 29, 2005 11:26 am

OnStatus Event C#

Post by avsomeren » Wed Jun 29, 2005 12:44 pm

Hi there,

I'm trying to get the status messages that appear in the logfile into a textbox. I added the eventhandler for the OnStatus event method :

Code: Select all




this.ftp.OnStatus += new IFTPConnectionEvents_OnStatusEventHandler(this.ftp_OnSourceStatus);







private void ftp_OnSourceStatus(enumStatusEventType t, string szText)



{



       this.Add_Log(szText);



}




The problem is that it appears that the events are not fired at all.

Do i miss something here ?


Regards,

Arie van Someren

avsomeren
Posts: 5
Joined: Wed Jun 29, 2005 11:26 am

Re: OnStatus Event C#

Post by avsomeren » Tue Jul 05, 2005 4:52 pm

Is there someone that can help me out on this one, i'm quite stumbled...

mb
Posts: 12026
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: OnStatus Event C#

Post by mb » Thu Jul 07, 2005 2:12 am

Hello ...

I haven't got the time to write a C# sample with events yet. But after the new version 1.5 is released I will take a look at your problem.

Thank you for your patience.
-Mat

avsomeren
Posts: 5
Joined: Wed Jun 29, 2005 11:26 am

Re: OnStatus Event C#

Post by avsomeren » Sat Jul 09, 2005 8:31 pm

Thnx for the response...

I've gotten the events to fire, no problem.
But i am trying to get the component to log to a richtextbox instead of a file....

The OnStatus event looks like the one to use, but the szText parameter is allways empty...

If i am taking on the wrong approach please tell me


best regards and keep up the good work,

Arie van Someren

mb
Posts: 12026
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: OnStatus Event C#

Post by mb » Sat Jul 09, 2005 8:38 pm

Hello ..

This looks like the right approach. The szText member shouldn't be empty. Is the enumStatusEventType t set?

-Mat

avsomeren
Posts: 5
Joined: Wed Jun 29, 2005 11:26 am

Re: OnStatus Event C#

Post by avsomeren » Sat Jul 09, 2005 10:42 pm

Ok

I found something out :

when i do a MessageBox.Show(szText), the values appear.
When i just try to add a line to the richTextBox, the lines are not added.

could this be a threading issue since i do not thread the ftp component?

btw, i am trying to figure out if IDENT is supported.
I cant find it in the logs and it would be crucial to me if it was incorporated.



regards,

arie

mb
Posts: 12026
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: OnStatus Event C#

Post by mb » Sun Jul 10, 2005 1:21 am

Hello ...

My guess is that you aren't correctly adding the line to the Rich Edit control. It usually requires special formatting (see .rtf files).

An ident server is not implemented by the ftp library. You need to implement your own.

Regards,
-Mat

Post Reply