0

我写了一个通用处理程序,所以我可以通过 javascript 访问我服务器的 COM 端口。

我这样做是因为我正在为 BOSE 的 ESP-88 编写一个 Web 界面,供内部使用。代码必须是可配置的,我添加了 TCP/IP 支持和 RS232 的例程。

在桌面应用程序中,代码运行良好,但在 ASP.net 4.0 应用程序中,代码崩溃并出现错误“访问端口 'COM2' 被拒绝。”。TCP/IP 连接有效,但我们也需要串行连接。

那么请问,如何让 ASP.net 应用程序使用我的 COM 接口?

谢谢!伊万

4

1 回答 1

1

Sounds like it is a case of permissions, the IIS server that is processing the ASP.NET pages does not have the privileges necessary to open the COM port.... as a matter of interest what are you using to communicate with the COM port?

The other clue is "Access to the port is denied" seems to suggest there is something else running. This implies that serial ports are exclusive access only, and only one process can access the serial port at any one time....

Edit:

After digging around, I think this link might be the best solution in the sense to get around the "Access denied on COM2", by using hooks and hook it in...I have not read the article but it looks like the one you are looking for...

于 2010-08-29T20:21:12.127 回答