示例#1
0
        public static void SaveConfig()
        {
            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            SetConfigValue(config, "AzureAccountKey", AzureAccountKey);
            SetConfigValue(config, "AzureAccountName", AzureAccountName);
            SetConfigValue(config, "SignatureSize", SignatureSize.ToString());
            SetConfigValue(config, "IsDev", IsDev);

            SetConfigValue(config, "RetryAttemptDelayInSeconds", RetryAttemptDelayInSeconds.ToString());
            SetConfigValue(config, "MaxRetryAttempts", MaxRetryAttempts.ToString());
            SetConfigValue(config, "DownloadDirectory", DownloadDirectory);
            SetConfigValue(config, "Verbose", Verbose.ToString());
            SetConfigValue(config, "AmDownloading", AmDownloading.ToString());
            SetConfigValue(config, "UseBlobCopy", UseBlobCopy.ToString());
            SetConfigValue(config, "ListContainer", ListContainer.ToString());
            SetConfigValue(config, "MonitorBlobCopy", MonitorBlobCopy.ToString());
            SetConfigValue(config, "ParallelFactor", ParallelFactor.ToString());
            SetConfigValue(config, "ChunkSizeInMB", ChunkSizeInMB.ToString());

            SetConfigValue(config, "SharedAccessSignatureDurationInSeconds", SharedAccessSignatureDurationInSeconds.ToString());


            config.Save(ConfigurationSaveMode.Modified);
            ConfigurationManager.RefreshSection("appSettings");
        }
示例#2
0
        public static void SaveConfig()
        {
            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            SetConfigValue(config, "AzureAccountKey", AzureAccountKey);
            SetConfigValue(config, "AWSAccessKeyID", AWSAccessKeyID);
            SetConfigValue(config, "AWSSecretAccessKeyID", AWSSecretAccessKeyID);
            SetConfigValue(config, "SrcAzureAccountKey", SrcAzureAccountKey);
            SetConfigValue(config, "SrcAWSAccessKeyID", SrcAWSAccessKeyID);
            SetConfigValue(config, "SrcAWSSecretAccessKeyID", SrcAWSSecretAccessKeyID);
            SetConfigValue(config, "TargetAzureAccountKey", TargetAzureAccountKey);
            SetConfigValue(config, "TargetAWSAccessKeyID", TargetAWSAccessKeyID);
            SetConfigValue(config, "TargetAWSSecretAccessKeyID", TargetAWSSecretAccessKeyID);
            SetConfigValue(config, "RetryAttemptDelayInSeconds", RetryAttemptDelayInSeconds.ToString());
            SetConfigValue(config, "MaxRetryAttempts", MaxRetryAttempts.ToString());
            SetConfigValue(config, "DownloadDirectory", DownloadDirectory);
            SetConfigValue(config, "Verbose", Verbose.ToString());
            SetConfigValue(config, "AmDownloading", AmDownloading.ToString());
            SetConfigValue(config, "UseBlobCopy", UseBlobCopy.ToString());
            SetConfigValue(config, "ListContainer", ListContainer.ToString());
            SetConfigValue(config, "MonitorBlobCopy", MonitorBlobCopy.ToString());
            SetConfigValue(config, "ParallelFactor", ParallelFactor.ToString());
            SetConfigValue(config, "ChunkSizeInMB", ChunkSizeInMB.ToString());
            SetConfigValue(config, "DestinationBlobTypeSelected", DestinationBlobTypeSelected.ToString());
            SetConfigValue(config, "SkyDriveCode", SkyDriveCode.ToString());
            SetConfigValue(config, "SkyDriveRefreshToken", SkyDriveRefreshToken.ToString());
            SetConfigValue(config, "DropBoxAPIKey", DropBoxAPIKey.ToString());
            SetConfigValue(config, "DropBoxAPISecret", DropBoxAPISecret.ToString());
            SetConfigValue(config, "DropBoxUserSecret", DropBoxUserSecret.ToString());
            SetConfigValue(config, "DropBoxUserToken", DropBoxUserToken.ToString());
            SetConfigValue(config, "SharepointUsername", SharepointUsername.ToString());
            SetConfigValue(config, "SharepointPassword", SharepointPassword.ToString());
            SetConfigValue(config, "SharedAccessSignatureDurationInSeconds", SharedAccessSignatureDurationInSeconds.ToString());

            SetConfigValue(config, "AWSRegion", AWSRegion.ToString());
            SetConfigValue(config, "SrcAWSRegion", SrcAWSRegion.ToString());
            SetConfigValue(config, "TargetAWSRegion", TargetAWSRegion.ToString());

            SetConfigValue(config, "MaxExecutionTimeInMins", MaxExecutionTimeInMins.ToString());
            SetConfigValue(config, "MaxServerTimeoutInMins", MaxServerTimeoutInMins.ToString());
            SetConfigValue(config, "BlobCopyBatchSize", BlobCopyBatchSize.ToString());

            config.Save(ConfigurationSaveMode.Modified);
            ConfigurationManager.RefreshSection("appSettings");
        }