0
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.PointOfService;
    using System.Collections;

    namespace ScalePOS
    {
        class ScalePOS
        {





            static void Main(string[] args)
            {

                // Create a new instance of PosExplorer and use it to 
                // collect device information.
                PosExplorer explorer = new PosExplorer();
                DeviceCollection devices = explorer.GetDevices();

                // Search all connected devices for an Scale, print its service object name



                foreach (DeviceInfo device in devices)
                {
                    if (device == null)
                    {
                        Console.WriteLine("device is null");
                    }

                   Console.WriteLine(device.ServiceObjectName);
                   Console.WriteLine(device.Type);
                   Console.WriteLine(device.HardwareId);
                   Console.ReadLine();


                            // It is important that applications close all open

                }
            }  
        }
    }

我正在尝试与 USB Scale 连接,但 PosExplorer 似乎没有接上它。当我运行这段代码时,我得到了一堆微软 MSR、扫描仪、钥匙锁模拟器,但我的规模没有被拿起。这里有人知道为什么不吗?

4

2 回答 2

1

找出问题所在,我需要一个 OPOS 驱动程序或与秤关联的服务对象。由于制造商没有提供我需要创建自己的。

于 2014-03-06T18:22:09.550 回答
1

您可以通过打开服务器资源管理器(查看菜单,然后服务器资源管理器)通过 Visual Studio 检查已安装的服务对象。

在服务器资源管理器(显示为树)中,展开“服务器”节点,然后是您的计算机名称节点,然后您可以在“LogicalDevice”、“POSDevice”或“ServiceObject”节点中检查您的特定设备.

我首先从“ServiceObject”节点开始!

于 2014-02-23T23:42:52.527 回答