Amazon.Runtime.EnvironmentAWSCredentials.EnvironmentAWSCredentials C# (CSharp) 메소드

EnvironmentAWSCredentials() 공개 메소드

Constructs an instance of EnvironmentAWSCredentials and attempts to load AccessKey and SecretKey from ConfigurationManager.AppSettings
public EnvironmentAWSCredentials ( ) : System
리턴 System
        public EnvironmentAWSCredentials()
        {
            NameValueCollection appConfig = ConfigurationManager.AppSettings;

            var accessKey = appConfig[ACCESSKEY];
            var secretKey = appConfig[SECRETKEY];

            if (string.IsNullOrEmpty(accessKey))
                throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Access Key could not be found.  Add an appsetting to your App.config with the name {0} with a value of your access key.", ACCESSKEY));
            if (string.IsNullOrEmpty(secretKey))
                throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Secret Key could not be found.  Add an appsetting to your App.config with the name {0} with a value of your secret key.", SECRETKEY));

            this._wrappedCredentials = new ImmutableCredentials(accessKey, secretKey, null);
        }