示例#1
0
        private async void CheckAuthCode(string authenticationCode)
        {
            try
            {
                using var client = await DataReceiveHelper.NewClientAsync();

                await client.ExecuteAsync(new TdApi.CheckAuthenticationCode
                {
                    Code = authenticationCode
                });
            }
            catch (TdException e)
            {
                var error = e.Error;
                ViewData["ErrorMessage"] = error.Message;
            }
        }
示例#2
0
        public async Task <IActionResult> SendAuthCode()
        {
            try
            {
                using var client = await DataReceiveHelper.NewClientAsync();

                await client.ExecuteAsync(new TdApi.SetAuthenticationPhoneNumber
                {
                    PhoneNumber = PhoneNumber
                });
            }
            catch (TdException e)
            {
                var error = e.Error;
                ViewData["ErrorMessage"] = error.Message;
            }

            return(RedirectToAction(nameof(Index)));
        }