private string GetTokenFromFile() { using (var reader = new StreamReader(filename)) { var token = reader.ReadLine(); return(Cryptographer.Decrypt(token)); } }
private void WriteDataToFile(string token, long user_ID) { using (var writer = new StreamWriter(filename)) { writer.WriteLine(Cryptographer.Encrypt(token)); writer.Write(Cryptographer.Encrypt(user_ID.ToString())); } }
private long GetUserIDFromFile() { using (var reader = new StreamReader(filename)) { reader.ReadLine(); var str = reader.ReadLine(); var id_str = Cryptographer.Decrypt(str); return(long.Parse(id_str)); } }