Serial Communication with Silverlight 5 (COM port)

前端 未结 3 538
南方客
南方客 2020-12-06 03:35

I\'m working on an ASP.NET website in which I\'ll need to access an usb device from the client side.

I\'ve seen that Silverlight 5, through the use of P/Invoke, allo

3条回答
  •  眼角桃花
    2020-12-06 04:14

    This helped me out A LOT ...

    Still, I lost quite a lot of time figuring out that you have to pass "COM10" as "\\.\COM10"

    Otherwise PInvoke of CreateFile keeps returning -1 (port not found)

    MS states: http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx

    "To specify a COM port number greater than 9, use the following syntax: "\.\COM10". This syntax works for all port numbers and hardware that allows COM port numbers to be specified."

    Yes, I realise most machines don't have 10 COM ports, but when you use Com0Com (great tool to simulate serial Null-modem, you end up with these hight port numbers ...)

    Figured I'd post this info, maybe it'll save someone some time ....

    All the best, Stijn, Belgium

提交回复
热议问题