Good day to all!

Tell me, please, how in the console application, you can enter a character set in the login-password windows on the gmail com site? Or, say, programmatically press the keyboard keys in the specified order? Perhaps, there is an option to copy in advance specified characters from the console in the Google form?

Thank you in advance!

  • Thanks here will not help! because you have no idea what you need, to work with servers and sites you need to study client-server interaction - the protocols of these interactions, requests to the server in the language of interest to you in this case C #, no one will write code for you. you are welcome! - Digital Core
  • one
    Set up Fiddler or Wireshark, log in to gmail as usual, see which requests were sent. Then send the same requests from the C # code. This can be done using the classes HttpClient , WebClient , HttpWebRequest . The type of application is completely unimportant. - Alexander Petrov
  • one
    Or use postman-intercepror, and then the requests caught in the postman look in the form of code in C # and copy-paste into your project. - tym32167
  • well, or look towards Selenium - tym32167

1 answer 1

What you want to do is easily solved with the help of Selenium . This is a powerful tool to automate the work with the browser.

Install Selenium.WebDriver , and:

 using OpenQA.Selenium.Chrome; ... static void Main(string[] args) { var driver = new ChromeDriver(); driver.Url = "https://accounts.google.com/signin/v2/identifier?continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&service=mail&sacu=1&rip=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin"; var inputEmail = driver.FindElementById("identifierId");//это Id инпута для ввода email inputEmail.SendKeys("user@gmail.com"); var btnNext = driver.FindElementById("identifierNext");//это Id кнопки "Далее" btnNext.Click(); ... Console.ReadLine(); } 

Naturally, in order to enter text into inputs and press buttons, you first need to find them on the page with pens (having studied the page code) and understand how they can be identified programmatically. In the given example Id elements are used.