Connecting Silverlight to the local computers COM port

前端 未结 10 822
清酒与你
清酒与你 2021-01-14 06:53

I have been searching high and low for a way to get my silverlight application talking to the COM port on my local computer. Has anybody out there been able to get Silverli

相关标签:
10条回答
  • 2021-01-14 07:06

    There's no access to computer resources, but you can communicate with sockets. So it's possible to have your users install an application which listens on a port and communicates with a COM port.

    Why are you trying to communicate with a COM port? If you're looking for webcam support, take a look at Jonas's hack which uses Flash to get webcam input: http://jonas.follesoe.no/WebcamInSilverlight2MacGyverStyle.aspx

    0 讨论(0)
  • 2021-01-14 07:09

    What if you want your application to run on Windows and Mac? Silverlight is a nice solution since it runs on both. If you have to write a WPF app or an ActiveX control, etc., this will bind you to Windows only again.

    0 讨论(0)
  • 2021-01-14 07:10

    Silverlight 4 enables you to communciate with COM (ActiveX). I have written a blog article about how to communicate with a COM library that supports communicating with the serial port.

    http://tech-michael.blogspot.com/2009/12/silverlight-talking-to-arduino.html

    Note that the ActiveXperts-object mentioned is commercial.

    0 讨论(0)
  • 2021-01-14 07:11

    You can still run it out of browser and utilise a wrapper like

    http://interopcom.codeplex.com/ (written by me)

    Regards, Paul

    0 讨论(0)
  • 2021-01-14 07:12

    You can do this by opening a socket connection from your Silverlight control to a local socket which intern have the COM port access

    0 讨论(0)
  • 2021-01-14 07:12

    You can connect Silverlight 5 to the local Comm Port as well as any other local resource, but only with the Silverlight application is running under Windows (not Mac) and when running either OOB (out-of-browser) or in-browser in Internet Explorer.

    The way this is done is by creating a classic COM automation component, and running the application with Full Trust. There is a registry key you can set to allow Silverlight 5 applications to be able to run with full trust in-browser, but the application must be signed and the public key must be imported to trusted publishers on the local machine.

    Once done, Silverlight supports AutomactionFactory, allowing you to access locally registered com automation objects. We use this feature extensively; it is very powerful. In this case we created a COM component that gives access to the SerialPort object, and gave it a method to return a list of all available ports.

    If AutomationFactory.IsAvailable Then
          SilPort = AutomationFactory.CreateObject("SilverPort.Ports")
          Dim AllPorts() As String
          AllPorts = SilPort.GetPortNames()
          ...
    End If
    
    0 讨论(0)
提交回复
热议问题