Exemplo n.º 1
0
        public async Task <string> Gettoken()
        {
            string path  = AppDomain.CurrentDomain.BaseDirectory + "token" + ".txt";
            string token = await ClientHttpController.GetToken();

            return(token);
        }
Exemplo n.º 2
0
        public async void Get_Token()
        {
            string path  = AppDomain.CurrentDomain.BaseDirectory + "token" + ".txt";
            string token = await ClientHttpController.GetToken();

            if (!File.Exists(path))
            {
                using (StreamWriter sw = File.CreateText(path))
                {
                    sw.WriteLine(token);
                }
            }
            else
            {
                using (StreamWriter sw = File.AppendText(path))
                {
                    sw.WriteLine(token);
                }
            }
        }