Exemple #1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            ulong    appId    = 6483795;          // указываем id приложения
            string   email    = "+375299616832";  // email для авторизации
            string   password = "******"; // пароль
            Settings settings = Settings.All;     // уровень доступа к данным
            Nora     nora     = new Nora();

            api.Authorize(new ApiAuthParams
            {
                ApplicationId = appId,
                Login         = email,
                Password      = password,
                Settings      = settings
            });

            var users = api.Friends.Get(new FriendsGetParams
            {
                UserId = 223333211,
            });

            list = nora.CatchFriends();
            string name;

            foreach (User_Contact c in list)
            {
                if (c.Birthday == DateTime.Now.Day.ToString() + "." + DateTime.Now.Month.ToString())
                {
                    MessageBox.Show(c.Name);
                }
            }



            //api.Messages.Send(new MessagesSendParams
            //{
            //    UserId = 223333211,
            //    Message = users[1].
            //}); // посылаем сообщение пользователю
        }
Exemple #2
0
        public void SyncUserContact()
        {
            Nora nora = new Nora();

            nora.Authorize();
            List <User_Contact> Friends = nora.CatchFriends();

            foreach (User_Contact con in Friends)
            {
                var contacter = new User_Contact
                {
                    Name        = con.Name,
                    MobilePhone = con.MobilePhone,
                    Email       = con.Email,
                    Birthday    = con.Birthday
                };

                database.Contacts.Add(contacter);
                database.SaveChanges();

                Contactso.Add(contacter);
            }
        }