Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Web browser control and bypassing authentication
Message
De
03/01/2005 12:38:35
 
Information générale
Forum:
ASP.NET
Catégorie:
Librairie contrôle Web
Divers
Thread ID:
00973739
Message ID:
00973874
Vues:
15
>Sorry, I forgot you mentioned you're using the IE Control inside the WinForm:
>
>You'll also need this code:
>
>
>// In the Initialize Component Method you'll need to add this line
>this.WebBrowser.DocumentComplete +=
>     new AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler
>     (this.WebBrowser_DocumentComplete);
>
>
>// in the WebBrowser_DocumentComplete Method you add:
>// Get the Document Element
>this.htmlDoc = (HTMLDocumentClass)WebBrowser.Document;
>
>// Get a referrence to the UserName Text Box
>HTMLInputElement txtUserName =
>     (HTMLInputElement)this.htmlDoc.all.item("txtUserName",0);
>txtUserName.value = ConfigurationSettings.AppSettings["UserName"];
>
>// Get a referrence to the Password Text Box
>HTMLInputElement txtPassword = (HTMLInputElement)this.htmlDoc.all.item("txtPassword",0);
>txtPassword.value = ConfigurationSettings.AppSettings["Password"];
>
>// get the html button next
>HTMLInputElement buttonLogin = (HTMLInputElement)this.htmlDoc.all.item("btnSubmit",0);
>
>btnSubmit.click();
>
Thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform