Ejemplo n.º 1
0
        private void UploadTemplateFiles()
        {
            string templateDirectory = DirectoryHelper.ReleaseDirectory + @"ZippedTemplates/";

            using (var client = SftpManager.GetClient(host, Username, Password))
            {
                client.Connect();


                foreach (var file in Directory.GetFiles(templateDirectory, "*.zip"))
                {
                    var fileName = FileManager.RemovePath(file);

                    string localFile   = templateDirectory + fileName;
                    string destination = _ftpFolder + "ZippedTemplates/" + fileName;
                    SftpManager.UploadFileWithOpenConnection(
                        localFile, destination, client);


                    Results.WriteMessage(file + " uploaded to " + destination);
                }

                client.Disconnect();
            }
        }
Ejemplo n.º 2
0
        private void UploadEngineFiles()
        {
            List <CopyInformation> engineFiles = CopyBuiltEnginesToReleaseFolder.CopyInformationList;

            using (var client = SftpManager.GetClient(host, Username, Password))
            {
                client.Connect();
                for (int i = 0; i < engineFiles.Count; i++)
                {
                    string localFile = engineFiles[i].DestinationFile;

                    string engineName     = FileManager.RemovePath(FileManager.GetDirectory(localFile));
                    string debugOrRelease = null;
                    if (engineName.ToLower() == "debug/" || engineName.ToLower() == "release/")
                    {
                        debugOrRelease = engineName;
                        engineName     = FileManager.RemovePath(FileManager.GetDirectory(FileManager.GetDirectory(localFile)));
                    }


                    string fileName = engineName + debugOrRelease +
                                      FileManager.RemovePath(localFile);
                    string destination = _ftpFolder + "SingleDlls/" + fileName;

                    SftpManager.UploadFileWithOpenConnection(
                        localFile, destination, client);


                    Results.WriteMessage(engineFiles[i].DestinationFile + " uploaded to " + destination);
                }
                client.Disconnect();
            }
        }