How to write in C# to check FTP connect or not?

  • Thread starter Thread starter ABC
  • Start date Start date
Use a try block, then do something that would provoke an exception if
you weren't connected.
 
I agree with this method - I use the same thing to check if a user has
access to the web during my applications initialisation.

I simply have a try catch block wrapped around a section of code that
performs a simple webrequest to our servers, if this is succesful I set a
boolean flag to true, if not the catch block sets the flag to false. I
presume you should be able to achive a similar thing with an ftp connection.

Regards

Darren Sim
 
I disagree.

use Old error handling in VB






I agree with this method - I use the same thing to check if a user has
access to the web during my applications initialisation.

I simply have a try catch block wrapped around a section of code that
performs a simple webrequest to our servers, if this is succesful I set a
boolean flag to true, if not the catch block sets the flag to false. I
presume you should be able to achive a similar thing with an ftp connection.

Regards






- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top