TLSharp
TLSharp copied to clipboard
How I can keep login after close my windows app?
How I can login after registration? I want login after close my windows app. By which method I can check in session file? this is my code
I solved this problem like this:
var store = new FileSessionStore();
client = new TelegramClient(123456, "xxxxxxxxxxhhaasshhxxxxxxxxx", store);
await client.ConnectAsync();
if (!client.IsUserAuthorized())
{
hash = await client.SendCodeRequestAsync(userNumber);
CodeFromTG.IsEnabled = true; //Button with a text box for entering a code
AuthButton.IsEnabled = true; //The button has its own click handler, it calls MakeAuthAsync where the third parameter is the code from the text box
}