2014-02-21 7 views
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가 인식하지 못하는 것 같습니다. 이 코드를 실행하면 Microsoft MSR, Scanner, Keylock 시뮬레이터가 많아 지지만 저울은 선택되지 않습니다. 여기 왜 아무도 안다고?PosExplorer(). getDevices가 내 눈금을 찾지 못했습니다.

+0

[기타] (http://stackoverflow.com/questions/11411745/pos-explorer-is-not-finding-any-device-connected-to-the-system-in-c-sharp) - [posts] (http://stackoverflow.com/questions/3481436/opos-posexplorer-getdevice-returns-null-when-executed-in-windows-service) 하드웨어 또는 보안 관련 항목입니다. –

+0

저울에 OPOS 드라이버 또는 서비스 개체가 설치되어 있습니까? –

+0

@JAnderson 잘 모르겠습니다. 이 일을 어떻게 하죠? – BurntCandy

답변

1

문제점이 무엇인지 파악한 결과, OPOS 드라이버 또는 스케일과 관련된 서비스 객체가 필요했습니다. 제조 업체가 제공하지 않았기 때문에 나는 내 제품을 만들 필요가있었습니다.

1

Visual Studio에서 서버 탐색기 (보기 메뉴, 서버 탐색기)를 열어 설치된 서비스 개체를 확인할 수 있습니다.

서버 탐색기 (트리로 표시됨)에서 "서버"노드를 확장 한 다음 컴퓨터 이름 노드를 확장 한 다음 "LogicalDevice", "POSDevice"또는 "ServiceObject"노드.

먼저 "ServiceObject"노드부터 시작합니다!