コード例 #1
0
        /// <summary>
        /// Run the code example.
        /// </summary>
        /// <param name="user">The Dfa user object running the code example.
        /// </param>
        public override void Run(DfaUser user)
        {
            // Create UserRemoteService instance.
              UserRemoteService service = (UserRemoteService) user.GetService(
              DfaService.v1_19.UserRemoteService);

              String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE");

              // Set user search criteria.
              UserSearchCriteria searchCriteria = new UserSearchCriteria();
              searchCriteria.pageSize = 10;
              searchCriteria.searchString = searchString;

              try {
            // Get users that match the search criteria.
            UserRecordSet users = service.getUsersByCriteria(searchCriteria);

            // Display user names, ids, network ids, subnetwork ids, and group ids.
            if (users != null && users.records != null) {
              foreach (User userResult in users.records) {
            Console.WriteLine("User with name \"{0}\", id \"{1}\", network id \"{2}\", subnetwork" +
                " id \"{3}\", and user group id \"{4}\" was found.", userResult.name, userResult.id,
                userResult.networkId, userResult.subnetworkId, userResult.userGroupId);
              }
            } else {
              Console.WriteLine("No users found for your search criteria.");
            }
              } catch (Exception e) {
            Console.WriteLine("Failed to retrieve users. Exception says \"{0}\"", e.Message);
              }
        }
コード例 #2
0
 public UserRecordSet getUsersByCriteria(UserSearchCriteria searchCriteria) {
   object[] results = this.Invoke("getUsersByCriteria", new object[] {searchCriteria});
   return ((UserRecordSet) (results[0]));
 }