LibUsbDotNet在linux上的使用

前置条件: 安装  libusb  mono编译环境

下载LibUsbDotNet源码后 :

  1. xbuild LibUsbDotNet.sln。

然后你就可以mono xxx.exe 。进行相关开发了

反正很魔幻 在linux上编译exe 然后在window上配置mono环境 然后就可以两边跑exe。

ps: 安装方法来自LibUsbHelp.chm(libusb安装包里面的)

LibUsbDotNet 2.2.8
Getting Started With Linux

C#Visual BasicVisual C++

 

LibUsbDotNet is compatible with linux/unix-like operating systems that support mono.net 2.0 and libusb v1.x.

Prerequisites

Note:

The user must have appropriate access permissions to the usb device before it can be used with linux. This is true for most unix-like OSes.

  1. If your platform has its own package manager (Aptitude, Synaptic, etc), use it to download and install the required software packages below.

  2. Download and install the libusb-1.0 package.

    If libusb-1.0 binaries do not exists for your platform, you must build them from source. Building libusb-1.0 from source is very straightforward. See the INSTALL documentation file in the libusb-1.0 source package for more details.

  3. Download and install the Mono.Net 2.x package.

    The pre-compiled Mono.Net runtime binaries are available for nearly all platforms. However, for information on bulding the mono.net runtime from source see Compiling_Mono.

Using the pre-built LibUsbDotNet Binary package.

  1. Download the LibUsbDotNet_Bin package and unzip it to a new sub-directory (LibUsbDotNet_Bin).

  2. Open a terminal window and navigate to the new LibUsbDotNet_Bin directory.

  3. Run the Test_Info application by typing: mono Test_Info.exe

    Test_Info should find all USB devices the user has access to and provides a device count in the status bar. If no devices are found, verify the user has sufficient access permissions, or try running as the root user.

Building LibUsbDotNet From Source

  1. Download the LibUsbDotNet_Src package and unzip it to a new sub-directory (LibUsbDotNet_Src).

  2. Open a terminal window and navigate to the new LibUsbDotNet_Src directory.

  3. The LibUsbDotNet.sln can be built with the xbuild tool:

    xbuild LibUsbDotNet.sln

     

你可能感兴趣的:(C#跨平台)