Ejemplo n.º 1
0
        private void aws_settings_Load(object sender, EventArgs e)
        {
            var config = AWSConfigurationManager.GetConfiguration();

            tbx_accessKey.Text      = config.AccessKey;
            tbx_secretKey.Text      = config.SecretKey;
            cbx_Region.SelectedItem =
                RegionEndpoint.EnumerableAllRegions.FirstOrDefault(r => r.DisplayName == config.Region);
        }
Ejemplo n.º 2
0
        private void ConfigureAmazonClient()
        {
            var config = AWSConfigurationManager.GetConfiguration();

            if (!string.IsNullOrEmpty(config?.Region))
            {
                var awsCredentials = new BasicAWSCredentials(
                    config.AccessKey,
                    config.SecretKey);

                var s3Config = new AmazonS3Config
                {
                    RegionEndpoint = RegionEndpoint.EnumerableAllRegions.FirstOrDefault(r => r.DisplayName == config.Region)
                };

                s3Client = new AmazonS3Client(awsCredentials, s3Config);
            }
        }