c# - WinSCP .NET Assembly FTP server does not release session when connection is closed -


i trying simple download of files ftp server. using .net assembly winscp provides. source ftp server has setting not allow more 3 sessions, need disconnect once files downloaded. able connect server, because every time try run program 4 times, disallows session.open saying max sessions allowed 3. have reboot machine end sessions.

http://winscp.net/eng/docs/library_session_close

am doing incorrectly? @ point i'm trying connect , disconnect portion work. i'm kinda new , appreciate help.

using system; using winscp;  class ftpdownload2 {     public static void main()     {         // setup session options         sessionoptions sessionoptions = new sessionoptions         {             protocol = protocol.ftp,             hostname = "name",             username = "uname",             password = "pwd!"         };          using (session session = new session())         {             // connect             session.open(sessionoptions);             session.close();         }     } } 


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -