Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7068413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:19:15+00:00 2026-05-28T05:19:15+00:00

The problem I want to solve: Get all the contacts info like name and

  • 0

The problem I want to solve:
Get all the contacts info like name and Mobile phone and write it into file and save in ISO.

  1. How to use SearchAsync if I want to search available contacts in the phone?
  2. How to iterate the return-results and write to file one by one of the contact into a file?

Here’s the code I have:

private void btnSearch_Click(object sender, RoutedEventArgs e)
{    
    Contacts contacts = new Contacts();     
    contacts.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(contacts_SearchCompleted);   
    contacts.SearchAsync(displayName,FilterKind.DisplayName,null);    
    //search for all contacts   
    contacts.SearchAsync(string.Empty, FilterKind.None, null);
}

Update:

  1. The below code throw NullException error if the PhoneNumber is Empty. Why?

  2. How to get all the possibile phone number other than result.PhoneNumbers.FirstOrDefault().ToString();

  3. Same question for EmailAddresses

Using this to search all contacts in the phone:

contacts.SearchAsync(searchterm, FilterKind.None, null);

void contacts_SearchCompleted(object sender, ContactsSearchEventArgs e)
{
    int intTTL = e.Results.Count();
    if (intTTL != 0)
    {
        MessageBox.Show(intTTL.ToString());
        foreach (var result in e.Results)
        {
            string strTTL;
            string strName = result.DisplayName;
            string MobileNo = result.PhoneNumbers.FirstOrDefault().ToString();
            strTTL = strName + "," + MobileNo;
            MessageBox.Show(strTTL);
        }
    else
    {
        MessageBox.Show("You have not entered any contact info at all.");
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:19:15+00:00Added an answer on May 28, 2026 at 5:19 am

    Have a look at this article to see how to get the Contacts:

    To iterate:

    void contacts_SearchCompleted(object sender, ContactsSearchEventArgs e)
    {
        foreach(var contact in e.Results)
        {
            // write to Isolated storage
        }
    }
    

    See this MSDN page for writing files in isolated storage

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem I am trying to solve is that I want to check all
Problem: I want to get all locations from a database and encase them all
I have the following problem that I want to solve in awk. I have
I want to solve the following optimization problem: Non-Latex: Given x and mu, find
Someone posted something similar but it didn't really solve the problem. I want to
I'm trying for hours now to solve this problem.. So.. I want to use
I want to get URLs of all images in multiline text (no matter what
I want to find all Contacts where the value of their :has_one relationship to
I've tried all sorts of design approaches to solve this problem, but I just
I have problem with my .htaccess redirections. Say I want to change http://www.domain.com/login.php into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.