【发布时间】:2011-03-29 17:28:51
【问题描述】:
下面的代码 sn-p 使用 OPOS .NET 打开 POS 打印机进行打印。当作为独立应用程序的一部分执行时,它可以正常工作。当由 Windows 服务执行时,对 GetDevice(...) 的调用始终返回 null。
explorer = new PosExplorer();
device_info = explorer.GetDevice(DeviceType.PosPrinter, PrinterName);
printer = (PosPrinter)explorer.CreateInstance(device_info);
printer.Open();
printer.Claim(1000);
printer.DeviceEnabled = true;
打印机恰好是 Epson TM-U220B。在服务访问 POS 设备之前,是否存在需要解决的安全问题?谁能推荐一个关于使用 OPOS .NET 开发 Windows 服务的良好信息来源?
【问题讨论】:
-
您解决了这个问题吗?我有一个问题,即 Open() 在 ASP.NET 中针对特定设备运行时失败,无论 IIS 的用户如何(但对于所有其他 OPOS 设备都可以正常工作)。
-
@Peter Beacom 我也遇到了类似的问题。但是当我在 Windows 7 机器上使用 Visual Studio 2005 时,问题没有发生。它适用于 Windows XP 中的所有 IDE。
-
此问题已解决。正如 Doobi 所建议的,问题不在于代码,而在于工作站的安全设置。
标签: c# .net epson opos pos-for-.net