Пример #1
0
        /// <summary>
        /// Delete a user's profile.
        /// </summary>
        /// <param name="authenticationToken">Encrypted forms auth token identifying the requesting user.</param>
        /// <param name="uniqueIdentifier">The unique identifiers of the users whose profile is being deleted.</param>
        /// <returns></returns>
        private static bool DeleteUserProfile(string authenticationToken, string uniqueIdentifier)
        {
            /*
             * 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.DeleteUserProfile(authenticationToken, uniqueIdentifier);

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

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