Ejemplo n.º 1
0
        //127.0.0.1/Myfriends/index.php?pseudo=rabah&action=info&what=p&value=072345321

        public async void ContactInfo()
        {
            ContactPicker x = new ContactPicker();
            IReadOnlyList <ContactInformation> contacts = await x.PickMultipleContactsAsync();

            if (contacts == null)
            {
                return;
            }

            HttpClient client = new HttpClient();

            string server = UserSingleton.server;

            server += "api.php?action=info";
            server += "&pseudo=" + usercurrent.Token;

            foreach (ContactInformation cont in contacts)
            {
                foreach (ContactField field in cont.PhoneNumbers)
                {
                    server += "&what[]=ContactPhone&value[]=" + cont.Name + "&value2[]" + field.Value;
                }
                foreach (ContactField field in cont.Emails)
                {
                    server += "&what[]=ContactEmail&value[]=" + cont.Name + "&value2[]" + field.Value;
                }
            }

            try
            {
                string res = await client.GetStringAsync(server);
            }
            catch
            {
                MessageDialog c = new MessageDialog("Erreur Server ne repond pas ");
            }
        }