如何通过ASP.NET C#中的串口从秤机获得重量# [英] How to get weight from scale machine via serial port in ASP.NET C#

查看:340
本文介绍了如何通过ASP.NET C#中的串口从秤机获得重量#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台比例称重机,我想从这台秤机上读取数据,并在文本框中获取数据



我尝试过:



我尝试了一个示例应用程序,但每次异常显示为拒绝访问且DataReceived方法不调用

I have one scale weight machine and i want to read data from this scale machine and get data in the textbox

What I have tried:

I have tried one sample application but every time exception shows as access denied and DataReceived method does not call

推荐答案

无法从Web浏览器直接访问本地计算机。出于安全原因,浏览器对机器资源的访问权限非常有限。



您需要依靠应用程序/服务来完成阅读工作。将其保存在您的站点可以访问的数据库/文件中。



可能还有其他选择。我很高兴在这里见到他们。





谢谢

--RA
There is no way to directly access the local machine from the web browser. For security reasons browsers have very limited access to the machines resources.

Either you need to depend on the application / service to done the reading job. Save this in database/file where your site can access.

There may be other alternatives. I am good see them here.


Thanks
--RA


假设比例是附加到客户端计算机而不是服务器...



从完全在服务器上运行的ASP.NET代码中,您没有。



从客户端浏览器中运行的javascript代码,你仍然没有。 Javascript只能访问Web服务器。这是一种限制,但没有任何说明Web服务器无法在客户端计算机上运行。所以,要利用它......



你必须编写一个没有UI的应用程序,它可以在客户端机器上安装并运行。这个应用程序将与规模进行对话并从中获取价值。它还有第二面是Web服务器。该服务器可以接受命令并将数据(如重量信息)返回给任何调用它的应用程序,例如在浏览器中运行的客户端javascript代码。
Assuming the scale is attached to the client machine and not the server...

From your ASP.NET code, which runs entirely on the server, you don't.

From javascript code that runs in the browser on the client, you still don't. Javascript can only take to web servers. That's kind of limiting, but there's nothing that says the web server cannot be running on the client machine. So, to take advantage of that...

You have to write an application, with no UI, that gets installed and runs on the client machine. This app is what will talk to the scale and get values from it. It will also have a second side to it that is a web server. This server can accept commands and return data, like weight information, to whatever app calls it, like your client-side javascript code running in a browser.


这篇关于如何通过ASP.NET C#中的串口从秤机获得重量#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆