예제 #1
0
        private void btnRemoveProfile_Click(object sender, EventArgs e)
        {
            //Amazon.Util.ProfileManager.UnregisterProfile(cboAWSProfilesToCleanUp.Text);
            //var AWSProfile = new Amazon.Runtime.CredentialManagement.SharedCredentialsFile();
            var netSDKFile = new NetSDKCredentialsFile();

            netSDKFile.UnregisterProfile(cboAWSProfilesToCleanUp.Text);

            GetProfilesToCleanUp();
            GetSavedProfiles();
            cboAWSProfilesToCleanUp.Text = "";
            btnRemoveProfile.Enabled     = false;
        }
예제 #2
0
    public static void MigrateProfile()
    {
        // Credential profile used to be stored in .net sdk credentials store.
        // Shared credentials file is more modern. Migrate old profile if needed.
        // Shows good form for profile management
        CredentialProfile profile;
        var scf = new SharedCredentialsFile();

        if (!scf.TryGetProfile(profileName, out _))
        {
            var nscf = new NetSDKCredentialsFile();
            if (nscf.TryGetProfile(profileName, out profile))
            {
                scf.RegisterProfile(profile);
                nscf.UnregisterProfile(profileName);
            }
        }
    }