accessing COM port using ASP.net : access denied
I've written a Generic Handler so I can access my server's COM port through javascript.
I'm doing this, because I'm writing a Web Interface to an ESP-88 from BOSE, for inte开发者_运维技巧rnal use. The code must be configurable, and I added routines for both TCP/IP support and RS232.
In a desktop app, the code runs fine, but in an ASP.net 4.0 App, the code crashes with the error "Access to the port 'COM2' is denied.". TCP/IP connections work, but serial is also required for us.
So please, how do I let ASP.net apps use my COM interfaces?
Thanks! Yvan
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...
精彩评论