How can I handle the exception which throws on an external dll?

后端 未结 4 610
北海茫月
北海茫月 2021-01-18 03:50

I have developed a project which uses an external dll as FTPServer, I have created the FTP Server on my project like this:

private ClsFTPServer _ClsFTPServer;

4条回答
  •  星月不相逢
    2021-01-18 04:28

    You've probably already tried this, but just in case, have you tried wrapping it in a try catch?

    try
    {
        _ClsFTPServer = new ClsFTPServer(FTPUserName, FTPPassword, FTPPath);
        ...
    }
    catch(Exception e)
    {
        ...
    }
    

提交回复
热议问题