示例#1
0
        public void CreateFile(AccountModelView account)
        {
            if (account != null)
            {
                Accounts accounts = new Accounts();

                accounts.Konten = new List <AccountModelView>();
                accounts.Konten.Add(account);

                List <Accounts> list = new List <Accounts>();
                list.Add(accounts);

                string filePath = "";
                using (StreamWriter file = File.CreateText(_filePath))
                {
                    JsonSerializer serializer = new JsonSerializer();
                    //serialize object directly into file stream
                    serializer.Serialize(file, list);
                }
            }
        }
 public bool checkLogIn(AccountModelView account, string key)
 {
     return(checkLogIn(account.Username, account.Password, key));
 }