Question WebBrowser Control Help

gigabeard

Member
Joined
Jan 18, 2010
Messages
9
Location
MN USA
Programming Experience
5-10
Hello,
I'm working on a pretty simple project, just a WebBrowser app which is tailored for Webmail.

I'm working on an OWA portion, and OWA normally doesn't allow the textfields on the Login page to be auto-filled. Is there a way I can force this? Search through the OWA login page code, find the fields, then fill in the fields with preset/saved data?

Thanks for any input! I'm new to working with WebBrowser control, so any help would be huge!
 
Sure, you can always traverse the html code and since it's plain text, you can insert stuff as well.

Are you using the Framework's WebBrowser control for this? Or is this an actual WebApp you're doing?
 
Hey JB. Nice to know there's some fellow Juggalo's in the software biz!

to answer some of your questions:
It is a WindowsForms application, utilizing only a WebBrowser control. It's just one form with one WebBrowser control, and that's it.

I added a little code to handle pop-ups and new windows, but besides that, it's very simple. The webbrowser control's deffault URL is my employer's OWA login page. Perhaps after the OWA page loads, call an event that sifts through the HTML code.

i took a look at the source of the OWA login page, and there are two cookies in a script for 'username' and 'password'. Is it possible to force those cookies send the request in one fell swoop? If so, can you provide some sample code on how to manipulate and HTML document within the WebBrowser control in a windowsforms app? (I don't want you to write the code for me, just a quick sample of how it works)

Thanks man!
 
When a page is loaded in the WebBrowser control you have full access to the page's source in the control's DocumentText property (it's a String) so you can use various methods to go through it, I recommend using Regular Expressions for this, and you can assign changes back to the DocumentText property. IE you can do this: WebBrowser.DocumentText = MyRegex.Replace("TheUserNamePart", "TheUserNamePartWithTheUserNameInserted)

Down with da klown 4 life bro, where ya from?
 
Alright, great thanks for the input. I'll try that out as soon as I get some free time (work before play).

From Minnesota here. Wicked clownin and sippin on Faygo for 12 years now. Where you at?
 
When you do get time to fiddle with the browser control, let me know how it goes.

I'm chillin a few mile south of Lansing, Michigan. I've been down since '99, never hard core though. My jobs the past 4 years keeps me from wearing my gear, so I'm kind faded out of that scene, I'm still on Psychopathic Forums twice a week, keepin in touch w/ homies.
 
Just got it working. Ended up using wb.Document.GetElementById("idname").SetAttribute("attribute","value")

Works perfect so far.

Yea, I never bought any of the clothes or anything (though I was just looking at the Hockey jerseys). listen to the wicked rap for the entertainment factor. ICP is like the cheesy horror film of the music industry, know what I mean? It's just fun to listen to. And they actually do produce some excellent tracks that are more than just cheesy entertainment. Like "Pass me by", also Twiztid's track "Afraid of me" is possibly the best written hiphop track i've ever heard. Yea, i wouldn't wear that stuff to work either
 
Back
Top