Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

How I can keep login after close my windows app? #1034

Open
ahmedibrahimsaadmostafa opened this issue Jul 1, 2021 · 1 comment
Open

How I can keep login after close my windows app? #1034

ahmedibrahimsaadmostafa opened this issue Jul 1, 2021 · 1 comment

Comments

@ahmedibrahimsaadmostafa
Copy link

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

@asvdvl
Copy link

asvdvl commented Jul 5, 2021

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
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants