Hi, I will be short and concise, I need some guidance:
I want to create desktop application that will connect to a user account through the web, or maybe it should implement the web browser itself, just with + functionality (manipulating the browser inside the desktop application), that will be able to click on Hyperlinks (images or just plain text), that will be able to write what I tell it to write in a textbox, and to click the submit button after that. That's what I need.
The application should work without the mouse at the moment that it is on.. It should work by itself.
I think that this can be done in 2 ways as I see it.
1) To manipulate the DOM tree.
2) Just to manipulate the different objects like Hyperlinks and text areas as graphical elements?
I am curious to know if I can work in VS 2008, C# and not just work with Internet Explorer? Maybe Chrome, or Firefox? Is that possible?
What I want, is for people to tell me, is that very hard to do? What should I know,, where should I go, since now,, I'm just stuck at the beginning ) Maybe it's not even possible?
The site that I'm talking about, that I need to connect to, is a (RIA) and it uses Ajax heavily, so parts of the webpage is updated constantly.. Hope this helps?
Thank you for your time in advance,, if you need other information, I will be glad to tell you more.
Loading
Sergiu TricoliciPosted Jan 21, 2012, 9:43 PM
Sam HobbsPosted Jan 21, 2012, 8:04 PM
Sergiu TricoliciPosted Jan 21, 2012, 7:16 PM
My next question is.. Can I connect to a browser with a desktop application and manipulate the browser's elements?
I don't mean, inserting the browser in my application, I mean connect somehow to it,, Like reading it's HTML, and then making changes to them?
Mahesh ChandPosted Jan 21, 2012, 12:50 PM
Sergiu TricoliciPosted Jan 21, 2012, 11:42 AM
I think that I'll post some other questions here when I'm finished with my research ;)
Sam HobbsPosted Jan 20, 2012, 2:59 PM
I forget the details of how to do something in a C# program when a link is clicked in a WebBrowser control in the C# program. I am sure I could figure it out but your question is very general and is asking many things. So let's keep things general; you can ask specific questions later (in separate threads) when you get there. Generally, I think you can find a specific link in a specific page and add an event handler for the click event for that link.
You are undecided about what you want to do, so it is difficult to provide answers. You ask about doing something that works for all (most) browsers but you also ask about doing something in a browser window that your program creates without showing the browser window to the user. Those are very different and contradictory requirements. If you want to do something that works for multiple browsers, then that would probably be an add-in and you would need one for each of a variety of browsers; IE, Firefox and Chrome would be different.
You can create a browser window using the InternetExplorer object and "scrape" that and interact with it (by your program) and it can all be done without showing the window to the user. The code you use to do that could be the same code you use with a WebBrowser window if you use the DOM (the mshtml.HTMLDocument object) that can be obtained from the HtmlDocument.DomDocument Property; the the HtmlDocument Class instance is in the WebBrowser.Document property. Please read my article so you understand the difference between the HTMLDocument and HtmlDocument objects. I could use the InternetExplorer object to scrape this web site's home page to get a list of new and recently updated articles and put that data into a database table and then show that data in a form. I could then keep track of what articles I have seen. As an editor for this web site, that could be very useful.
I am working with that stuff now. So for example it would be beneficial to be able to use a desktop editor for creating a post such as what I am doing now except in a separate editor. So I might write a program that finds the IFrame in this web page and gets the HTML document in the IFrame and puts the document in a different web page, then it could be edited there, and then the document could be put back into the forum's web page (such as what I am typing into now).
VulpesPosted Jan 20, 2012, 11:02 AM
Check out this article by Mahesh to get started:
http://www.c-sharpcorner.com/uploadfile/mahesh/webbrowser-control-in-C-Sharp-and-windows-forms/
Sergiu TricoliciPosted Jan 20, 2012, 10:41 AM
I want to know if it's possible to make a browser, and to manipulate with the browser elements after loading a page, in windows forms.