示例#1
0
        /// <summary>
        /// Set a user's email address.
        /// </summary>
        /// <param name="authenticationToken">Encrypted forms auth token identifying the requesting user.</param>
        /// <param name="uniqueIdentifier">The unique identifier of the user to update.</param>
        /// <param name="newEmailAddress">The new email address.</param>
        private static bool ChangeUserEmailAddress(string authenticationToken, string uniqueIdentifier, string newEmailAddress)
        {
            /*
             * If you are unable to reference System.Service make sure that the project is configured to
             * use the full 4.0 framework and not the client profile.
             */
            var proxy = new UserManagementServiceClient();
            var result = proxy.ChangeUserEmailAddress(authenticationToken, uniqueIdentifier, newEmailAddress);

            // Handle exceptions
            if (!result.CallSuccess)
            {
                Console.WriteLine(result.FailureMessage);
                return false;
            }

            // The ChangeUserPassword method does not return ResultData. Return true if the operation completed successfully.
            return true;
        }