Пример #1
0
        // get file from SFTP and return string
        public void getFromSFTP(string url)
        {
            try
            {
                myFileStream = new FileStream(@"\NVRAM\temp.txt", FileMode.Create);
                mySFTPClient = new SftpClient(url, 22, "Crestron", "");

                mySFTPClient.Connect();
                mySFTPClient.DownloadFile(url, myFileStream, DownloadDone);

                return;
            }
            catch (Exception e)
            {
                CrestronConsole.PrintLine("Exception {0}", e);
                return;
            }
            finally
            {
                mySFTPClient.Disconnect();
                myFileStream.Close();
            }
        }
Пример #2
0
        // get file from SFTP and return string
        public void getFromSFTP(string url)
        {
            try
            {
                myFileStream = new FileStream(@"\NVRAM\temp.txt", FileMode.Create);
                mySFTPClient = new SftpClient(url, 22, "Crestron", "");

                mySFTPClient.Connect();
                mySFTPClient.DownloadFile(url, myFileStream, DownloadDone);

                return;
            }
            catch (Exception e)
            {
                CrestronConsole.PrintLine("Exception {0}", e);
                return;
            }
            finally
            {
                mySFTPClient.Disconnect();
                myFileStream.Close();
            }
        }