I want to know if I will be able to control a web browser using a C# program. What I want to do is the following:
I want to create a windows desktop application which will allow me to Open a web-browser (google chrome), input a webpage address, go to a web page, type something in a specific field or click something.
All of the above would have to be done automatically by the C# application without any user intervention after he opens up the application.
I want to know is it possible doing it in C# ? and if it isn't I would like some suggestions guiding me how would I go about creating this app, what programming language should I take a a look at or what should I research.
I only want a guidance for how I should go about creating this application.
Thanks to anyone who is going to answer ;)
There are a few possibilities to achieve this:
Use WatIn http://www.codeproject.com/Articles/17064/WatiN-Web-Application-Testing-In-NET
Or Selenium http://docs.seleniumhq.org/
Use WebClient, HttpRequest, HttpResponse classes
Related
We are currently using jQuery to populate web forms. jQuery receives its information from parsing the results of an executed php script. This works, but is completely dependent on the web server being accessible and functional.
We'd like to see how to consolidate this and create a C# console, WinForms application - or possibly a toolbar/IE addon of sorts down the road.
Right now we are trying to figure out how we can interact with an external Internet Explorer process (most examples we see are in regards to WebBrowser controls). We're ultimately wanting to fetch elements by name/id and populate them with text. From an end-user standpoint, we want to mimic the functionality of roboform.
We are not interested in form submission - just acqusition of the proper instance of IE and form population.
Are there any resources you could point us to that would have an example similar to our desire?
It used to be possible, I did that for IE7: How to connect to a running instance of Internet Explorer. I haven't verified if it still works for IE8+. You may also have some luck using this technique: How to get IHTMLDocument2 from a HWND.
I want to run my WPF application on asp.net web application. Actually I have a WPF page.xaml which contain the image viewer, which actually open image and edit it as required.
Now I want to embed that in my Asp.net Web application. I have a asp.net web application user control on which I want that WPF stuff. I research on it on the internet, I find a way that we first publish the WPF application on the IIS server and then past the URL in asp.net web application page iframe. as I follow this below link:
http://msdn.microsoft.com/en-us/library/aa970060.aspx#deploying_a_xbap
now I not want to follow this approach. I want an alternate way of this. Is there any way to handle this scenario. If yes then how can we achieve this?
Yes there's a better way: you can use Silverlight (basically it's a C# equivalent to Flash).
Even if Silverlight is quite the same as WPF, there is some differences due to the fact that silverlight is made for web. So you'll have to make some changes to your application.
About integrating it in your page, it seems quite simple:
You can use an object html element (as you would do with Flash)
Here are some links about that:
http://msdn.microsoft.com/fr-fr/library/cc838145(v=vs.95).aspx
http://www.c-sharpcorner.com/uploadfile/raj1979/host-silverlight-in-Asp-Net/
2 years later, a possible answer appears! Maybe someone else will see this and get some use out of it.
I have been hearing rumors that it is possible to run your WPF application in a browser, it's called an XBAP?
https://msdn.microsoft.com/en-us/library/aa970060%28v=vs.110%29.aspx
I am about to give this a try myself, I'll update this answer with any limitations I find.
I have some problem using default WebBroswer with C#.
I'm making program in C# WindowsForm. I would have multiple "tabs" of "Broswer" and i need to change many things like UserAgent .
I had problem to do this with default WebBrowser becouse the trick(found on stackoverflow) worked only for 1 page and dont for all session.
Olso i need JavaScript support.
My Question is :
Is there another webBroswer that emulate multiple "tabs" of webBrowser , support javaScript (This is very important : i need disable Javascript for a website page that have Location Header ), and that it's possible change UserAgent and so emulate all existing Browsers ?
If answer it's not What kind of "real" browser could i use with My c# WinForm Program?
Regards
Edit: I already used GeckoFX but without good result (with JavaScript)
You could try awesomium.
You'll have to write some code yourself (including tabs) as it's just a framework.
However, I haven't come across anything on for .net that comes close and it should meet your requirements.
There is a free license for "Indie Companies" (if you made less than $100k), non-commercial use or evaluation & dev purposes.
Downside is, you wont get access to the source for free, I don't know if that's a deal-breaker for you or not.
Pricing
I'm looking for solution how to integrate WPF desktop application with reCaptcha! Anyone knows the solution?
I'm working on registration module to my application, and need good and simple captcha.
Thanks!
See https://developers.google.com/recaptcha/docs/display and https://developers.google.com/recaptcha/docs/verify.
You could make an request to http://www.google.com/recaptcha/api/challenge?k=your_public_key and parse the ChallengeValue. This value can be used to get the recaptcha image via http://www.google.com/recaptcha/api/image?c=challenge_value. Afaik URL Images can be displayed in WPF directly.
Let the user input into a TextBox (or similar) control.
For verification, use this input and make a request to http://www.google.com/recaptcha/api/verify (see documentation above).
Have you tried this - http://code.google.com/apis/recaptcha/docs/aspnet.html. It says it works in any .Net language, including C#. There is also this page although it is 2 years old.
Im a c# developer and I believe that what I want to achieve is going to move out of the realms of some drop in .NET component so I am looking for advise on what I use externally which .NET can inter op with.
My requirements are to have an embedded web browser control in a WPF/Winforms applciation BUT I will also need to keep track of the following:
User interaction i.e. what pages they visit, forms submitted where they click etc.
DOM manipulation and traversing
I am guessing here but it seems that I might need to start looking at open source html/web browsers out there like WebKit etc. Is this the right track or is there anything currently available in the form of a control/COM object that I can use directly.
Cheers, Chris.
You should be able to accomplish point 1 using the webbrowser control in Visual Studio, but I dont think DOM manipulation is available, i do know you can traverse all the tags.
reference