2012-05-31 8 views
3

EPSON 열전 사 프린터 TM-88IV를 가지고 있습니다. 내가 프린터의 다양한 속성을 얻을 수 있어요하지만, 다음과 같은 상태 얻기 위해 하나를 찾을 수 없습니다 :EPSON 열전 사 프린터 모델 TM-88IV

  1. 종이 밖으로
  2. 프린터가 오류 상태입니다
  3. 프린터가 꺼

입니다 다음 코드를 사용하고 있습니다 :

string printerName = "EPSON"; 
string query = string.Format("SELECT * from Win32_Printer WHERE Name LIKE '%{0}%'", printerName); 
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query); 
ManagementObjectCollection coll = searcher.Get(); 

foreach (ManagementObject printer in coll) 
{ 
    MessageBox.Show(printer.Properties["Name"].Name + " - " + printer.Properties["Name"].Value 
     + "\n" + 
     printer.Properties["PrinterStatus"].Name + " - " + printer.Properties["PrinterStatus"].Value 
     + "\n" + 
     printer.Properties["DetectedErrorState"].Name + " - " + printer.Properties["DetectedErrorState"].Value 
     + "\n" + 
     printer.Properties["ExtendedDetectedErrorState"].Name + " - " + printer.Properties["ExtendedDetectedErrorState"].Value 
     + "\n" + 
     printer.Properties["ExtendedPrinterStatus"].Name + " - " + printer.Properties["ExtendedPrinterStatus"].Value 
     ); 
} 

위의 속성에 대해 다양한 값을 얻었지만 매핑 할 수 없습니다. 프린터의 상태.

출력은 내가 프린터와 함께 CD에 들어있는 EPSON TM-88IV 드라이버를 설치 한

Name: EPSON TM-T88IV 
PrinterStatus : 3 
DetectedErrorState: 0 
ExtendedDetectedErrorState: 0 
ExtendedPrinterStatus: 2 

입니다.

답변

2

분명히 DetectedErrorStateExtendedDetectedErrorState알 수없는을 의미 0 보여줍니다. 이 프린터가이 속성을 지원하지 않는다는 의미입니까, 현재 사용중인 드라이버가 지원하지 않습니까? 아니면 잘 모르겠습니다. 또한 ExtendedPrinterStatus2을 나타내며 을 나타내며을 의미합니다.

PrinterStatus을 의미하므로 여기에서 유용한 정보를 수집 할 수 없습니다.

PrinterState을 (를) 쿼리 해보십시오. 이 속성은 쓸모 없게 표시 되었기 때문에 긴 장면이지만이 코드는 코드 줄 일 뿐이며 무엇이 반환되는지 살펴 봅니다.

이 프린터를 통지, 당신이 직접 그 상태를 읽을 수 있습니다 다시 자동 상태 (이 ASB)을 지원한다 각 반환 값은 here

편집
를 발견 무엇을 의미하는지에 대한

더 많은 정보 WMI를 사용하지 않고 프린터에서 가져옵니다. ASB에 대한 자세한 내용은 Refer to this SO question을 참조하십시오. Here is the specification for your printer

+0

@Dejan ... PrinterStatus가 코드 3을 제공합니다 – HotTester

+0

PrinterState가 값 0을 제공합니다. – HotTester

관련 문제