获取USB端口号以进行直接打印 [英] Get USB port Number for direct printing

查看:253
本文介绍了获取USB端口号以进行直接打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VB6中,我们可以使用MsCom对象将输出(MSComm1.Output =test)发送到打印机等设备,而无需安装打印机。为此,我给COM对象提供COM端口号。(MSComm1.CommPort = 1)



但是在没有安装的情况下使用USB打印机时,我该如何给端口数字,因为它不是COM端口。

In VB6 we can use MsCom object to send outputs (MSComm1.Output ="test") to devices like printers without installing the printer. For that I give COM port number to the com object.(MSComm1.CommPort=1)

But when using the USB printer without installing, how can I give the port number as it is not the COM port.

推荐答案

正如您所正确提到的,USB不是COM。 USB不使用COM端口号。因此无法做你想做的事。



1)安装打印机驱动程序并使用.NET的 PrintDocument [ ^ ] class。



2)或者,找到一些特定于产品的非标准方式直接使用 #usblib [ ^ ]。你必须自己处理usb端点和连接。我强烈推荐第一种选择。
As you correctly mention, USB is not COM. USB does not use COM port numbers. Therefore there is no way to do what you want.

1) Install the printer driver and use .NET''s PrintDocument[^] class.

2) Or, find some product-specific non-standard way to talk to the printer directly using #usblib[^]. You will have to handle usb end points and connections and stuff yourself. I highly recommend the first alternative.


这篇关于获取USB端口号以进行直接打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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