服务器和客户端USB设备之间的通信是否可行? [英] Is communication between a server and a client's USB device possible?

查看:491
本文介绍了服务器和客户端USB设备之间的通信是否可行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过互联网与连接到客户端系统的USB设备进行通信,

我必须连接到设备连接到客户端的端口,然后调用执行我身边的一个功能,

所以在一个场景中,我需要与USB设备进行通信,而不需要在客户端上连接任何代码,

代码USB设备是由其制造商提供的(我只是使用该库),但由于机密性,它不能驻留在客户端机器上,



我是什么尝试过:



I would like to communicate with a USB device attached to a client system via Internet,
I have to connect to the port the device is connected to on the client side, and then invoke the execution of a function on my side,
So in a scence I need to communicate with that USB device without having any code on the client were it is attached to,
The code of the USB device is provided by its manufacturer(I just use the library), but it cannot reside on the client machine because of confidentiality,

What I have tried:

public void ConnectRemoteDevice()
{
    SerialPort mySerialPort = new SerialPort("COM10");
    mySerialPort.BaudRate = 9600;
    mySerialPort.ErrorReceived += DataReceivedHandler;
    mySerialPort.Parity = Parity.None;
    mySerialPort.StopBits = StopBits.One;
    mySerialPort.DataBits = 8;
    mySerialPort.Handshake = Handshake.None;
    mySerialPort.DataReceived += DataReceivedHandler;
    mySerialPort.Open();
    mySerialPort.ReadExisting();
    mySerialPort.Close();
}

private void DataReceivedHandler(object sender, SerialErrorReceivedEventArgs e)
{
    SerialPort sp = (SerialPort)sender;
    string indata = sp.ReadExisting();
    Debug.Print("Data Received:");
    Debug.Print(indata);
    GetMeasure();
}
public string GetMeasure()
{
    //the code to trigger the USB device and get the data from it
}

推荐答案

您是否希望服务访问您的USB设备?当然这是不可能的。
Would you want services accessing your USB devices? Of course this isn't possible.


原则上,如果用户不合作,远程服务器无法访问PC。

合作可以是硬盘驱动器或打印机共享,但你需要凭据。

合作可以是客户从服务器打开一个网络应用程序,它可以打开访问凸轮,但只有在客户允许的情况下。

为了将凸轮暴露给网络应用程序和远程服务器,你需要一个特殊的驱动程序,你的USB设备需要相同类型的驱动程序。

By principle, a remote server don't have access to a PC if user don't cooperate.
Cooperation can be HDD or printer sharing, but you need credentials.
Cooperation can be client opening a web app from server, it open access to cam, but only if client allow it.
In order to expose the cam to web app and remote server, you need to have a special driver and you will need the same kind of driver for your usb device.
引用:

USB设备的代码由其制造商提供(我只是使用该库),但由于机密性,它不能驻留在客户端机器上,

The code of the USB device is provided by its manufacturer(I just use the library), but it cannot reside on the client machine because of confidentiality,



usb设备的驱动程序必须在客户端PC上,无论如何。

如果客户端没有安装特定软件以将设备暴露给外部,则远程服务器将无法访问该设备。


A driver for the usb device must be on client PC, no matter what.
If client don't install specific software to expose the device to outside, your remote server will not have access to the device.


这篇关于服务器和客户端USB设备之间的通信是否可行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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