using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WinSCP;

namespace RevampPhilipsService
{
    class CFTPS
    {
        /// <summary>
        /// testing...
        /// </summary>
        /// <returns></returns>
        public bool GetFiles()
        {
            try
            {
                // Setup session options
                SessionOptions sessionOptions = new SessionOptions
                {
                    Protocol = Protocol.Sftp,
                    HostName = "sftp.easycareonline.com",
                    UserName = "intellica_00004",
                    Password = "IntRes_972345",

                    //WinSCP server and protocol information will have the fingerprint
                    SshHostKeyFingerprint = "ssh-dss 1024 70:6f:8b:a0:48:df:9d:3f:d2:f3:5b:7d:13:11:b5:11"
                };

                Session session = new Session();

                // Connect
                session.Open(sessionOptions);

                // Upload files
             //   TransferOptions transferOptions = new TransferOptions();
               // transferOptions.TransferMode = TransferMode.Binary;

//                TransferOperationResult transferResult;
  //              transferResult = session.PutFiles(@"d:\toupload\*", "/home/user/", false, transferOptions);

                // Throw on any error
    //            transferResult.Check();

                // Print results
      //          foreach (TransferEventArgs transfer in transferResult.Transfers)
        //        {
          //          Console.WriteLine("Upload of {0} succeeded", transfer.FileName);
            //    }
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: {0}", e);
                return false;
            }
            

            return true;

        }


    }
}
