简体   繁体   中英

Login username and password in Gmail with Windows 10 iot on raspberry Pi

I have created app where I have added webview and redirected to Gmail login page.

GmailWebView.Navigate("https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1&ltmpl=default&ltmplcache=2&emr=1&osid=1#identifier")

Now I want to add user id and password and click on login but not able to do that. I am unable to add System.Windows.Forms.WebBrowser so I can use it. Do we have any thing in win10 iot to complete this.

First subscribe on NavigationCompleted in your webView like below

<WebView x:Name="webView" NavigationCompleted="webView_NavigationCompleted"></WebView>

After you navigate to your url and the navigate complete the NavigationCompleted raised.and you can controll your webView.

   await webView.InvokeScriptAsync("eval", new[] {
       "var usernameText=document.getElementById(\"UserName\");"+
       "var passwordText=document.getElementById(\"Password\");"+
       "var button=document.getElementById(\"SubmitButton\");"+
       "button.attachEvent('onclick', MyButtonClicked);"+
       "function MyButtonClicked(){" +
           " //click Function"+
       "}"
   });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM