如何将基于网络的计算器变成可调用的程序?

发布于 2024-09-11 04:36:45 字数 147 浏览 1 评论 0原文

我想从 C# 程序访问网页上有一个免费的在线计算器。该计算器非常简单——只是一个 HTML 表格。没有 JavaScript 或 Flash。我希望能够将此页面变成我可以调用的方法。该方法可能会调用网页,输入适当的数字,读取结果,然后返回结果。

最好的方法是什么?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼泪也成诗 2024-09-18 04:36:45

我会尝试使用 WebBrowser 类加载网页,如果它是服务器端计算器,您应该找出 GET/POST 参数来提供输入并选择所需的功能(您可以通过分析 HTML 源代码来完成此操作) )并请求答案页。如果它是客户端计算器,您应该使用 DOM 解析器(查看 HTMLDocument 类)。

如果这个计算器真的很简单,我会考虑重新实现它或者尝试找到一个预先编写的组件,我认为它应该更容易(如果是客户端计算器,你可以有 javascript 源代码)。

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文