开发者

Webbrowser control: auto fill textfields

I would like my custom browser to auto fill in a form when it is completely loaded

Ok so inside

   private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    { }

Ive inserted the following statements

webBrowser1.Document.GetElementById("FirstName").SetAttribute("value", "John");
webBrowser1.Document.GetElementById("LastName").SetAttribute("value", "Smit开发者_如何学运维h");
// etc..etc..

I noticed that "webBrowser1_DocumentCompleted" only is loaded one time?? How do i make my browser auto fill in a form when the document has finish loading, and auto fill the values to the define values if they have been changed by the end user.


auto fill in a form when the document has finish loading You need to skip the documentcomplete events triggered frames. Hint: check the webbrowser's status property.

auto fill the values to the define values if they have been changed by the end user. In the Navigating event handler, get the form values and save them somewhere, preferably after encryption.

If you do not provide your own password storage and want to use Windows's, check http://social.msdn.microsoft.com/forums/en-US/winformsdesigner/thread/db373409-9366-47bd-bdf0-79493ffa0f22/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜