void BindListView()
 {
     try
     {
         var file = File.ReadAllLines(fileName);
         foreach (string item in file)
         {
             string[] splitedItems = item.Split(':');
             NewUserNameInfoList.Add(new FacebookUserLoginInfo {
                 LoginUserName = splitedItems[0]
             });
         }
     }
     catch (Exception)
     {
     }
 }
Beispiel #2
0
        private void NewUserCommandHandler(object obj)
        {
            if (!string.IsNullOrWhiteSpace(TxtUserId) && !string.IsNullOrWhiteSpace(TxtPassword))
            {
                string Credential = TxtUserId + ":" + TxtPassword;

                SqLiteHelper sql1 = new SqLiteHelper();


                string query1 = "select Count(*) from Users where UserName='******'";

                int count = Convert.ToInt32(sql1.ExecuteScalar(query1));


                if (TxtUserId != null && TxtPassword != null)
                {
                    if (count == 0)
                    {
                        string query = "INSERT INTO Users(UserName,Password,FacebookId) values('" + TxtUserId + "','" + TxtPassword + "','" + TxtUserId + TxtPassword + "')";

                        int yy = sql.ExecuteNonQuery(query);

                        NewUserNameInfoList.Add(new FacebookUserLoginInfo {
                            LoginUserName = TxtUserId
                        });
                        MessageBox.Show("Save successfully");
                    }
                }



                UserAdded(new SocialUser {
                    InboxUserName = TxtUserId, Password = TxtPassword
                });
                //UserAdded(new SocialUser { InboxUserName = TxtUserId });
                TxtUserId   = null;
                TxtPassword = null;
            }
            else
            {
                MessageBox.Show("Please enter valid username and password..!");
            }
        }