[HttpGet] public string getAllPrintNameDetail2(string yaziciAd) { try { var server = new LocalPrintServer(); PrintQueue queue = server.GetPrintQueue(yaziciAd); bool isOutOfPaper = queue.IsOutOfPaper; bool isOffLine = queue.IsOffline; bool isPaperJam = queue.IsPaperJammed; bool isNotResponding = queue.IsInError; if (isOffLine) { return "Printer is offline"; } if (isOutOfPaper) { return "Printer is out of paper"; } if (isPaperJam) { return "Printer has a paper jam"; } if (isNotResponding) { return "Printer is in error"; } return "Printer çalışıyor"; } catch (Exception ex) { return "hata 56 " + ex.Message; } } |