views:

36

answers:

1

There is a free, online calculator on a web page that I want to access from a C# program. The calculator is very simple -- just an HTML table. There is no JavaScript or Flash. I want to be able to turn this page into a method that I can call. The method would presumably call the web page, enter the appropriate numbers, read the result, and then return the result.

What is the best way to do this?

+2  A: 

I would try loading the web page with WebBrowser class, if it's a server side calculator you should figure out the GET/POST parameters to give input and choose desired functionality (you could do this by analyzing the HTML source) and request the answer page. If it is a client side calculator, you should use the DOM parser (look at HTMLDocument class).

If this calculator is really simple, I would consider re-implementing it or try to find a pre-written component, I think it should be easier (you could have the javascript source in case of client side calculator).

WebMonster