PointOfService 设备共享PointOfService device sharing

了解如何在多台电脑依赖于共享外围设备(而不是连接到每台计算机的专用外围设备)的环境中,与其他计算机共享网络或蓝牙连接的外围网络。Learn how to share network or Bluetooth connected peripherals with other computers in an environment where multiple PCs rely on shared peripherals rather than dedicated peripherals attached to each computer.

设备共享Device sharing

网络和蓝牙连接的 PointOfService 外设通常用于 wheere 多个客户端设备在一整天共享同一外围设备的环境中使用。Network and Bluetooth connected PointOfService peripherals are typically used in an environment wheere multiple client devices are sharing the same peripherals throughout the day. 在繁忙的零售或食品服务环境中,客户端设备连接到外围设备的任何延迟都会影响到相关工作效率,即关联可以与客户关闭交易,然后继续下一步。In a busy retail or food services environment any delay in the ability for a client device to attach to a peripheral has an impact on the efficiency in which an associate can close a transaction with the customer and move on to the next. 在 "快速服务餐厅" 方案中,使用收据打印机作为厨房打印机,以将客户订单的详细信息传送到厨房进行准备,其中有多个客户端设备从客户那里获得订单。In a quick service restaurant scenario where a receipt printer is used as a kitchen printer to transfer the details of a customer's order to the kitchen for preparation there will be multiple client devices taking orders from customers. 当订单完成后,每个客户端设备应该能够声明共享打印机,并立即打印厨房的顺序。Once the order is complete each client device should be able to claim the shared printer and immediately print the order for the kitchen.

在这些环境中,应用程序必须完全 释放 设备对象,以便另一台设备可以声明同一设备,这一点非常重要。In these environments, it is important for the application to fully dispose the device object so that another can claim the same device.

在 "using" 块的末尾释放 PosPrinterDisposing of a PosPrinter at the end of a ‘using’ block

using Windows.Devices.PointOfService;
using(PosPrinter printer = await PosPrinter.FromIdAsync("Device ID"))
{
    if (printer != null)
    {
        // Exercise the printer.
    }

    // When leaving this scope, printer.Dispose() is automatically invoked, 
    // releasing the session we have with the printer.
}

通过显式调用 Dispose ( 释放 PosPrinterDisposing of a PosPrinter by calling Dispose() explicitly

using Windows.Devices.PointOfService;

PosPrinter printer = await PosPrinter.FromIdAsync("Device ID");
if (printer != null)
{
    // Exercise the printer, then dispose of the printer explicitly.
    printer.Dispose();
}

使用的 API 方法API methods used

支持和反馈Support and feedback

查找问题的答案Find answers to your questions

有问题?Have questions? 向我们提供有关 UWP 标记的论坛pointofservice 标记 Stack Overflow上的&文档。Ask us on either our Docs Q&A forum with the UWP tag or on Stack Overflow with the pointofservice tag.

帮助我们找到你的问题:Help us locate your questions:

  • pointofservice 标记添加到 Stack Overflow 上的问题。Add the pointofservice tag to your question on Stack Overflow.
  • 在论坛上的 Q&中包含 "UWP" 词条Include the "UWP" term in your post on the Q&A forum