Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个我写的应用程序使用串行端口(连接到它的手持扫描仪),我需要以某种方式检测另一个用户切换,以便我可以关闭该端口,当新用户登录到应用程序时,它不会得到“端口”使用'错误。有什么建议么?我的程序在 VB.Net 中,但可以接受任何建议。
不幸的是,这是一个普遍的问题。
我发现最好的办法是创建一个 Windows 服务来处理所有通信,这样它就可以独立于任何登录的用户工作。您可以使用 WCF/Web 服务从 Windows 服务中获取数据。
我希望这有帮助。
(如果可以的话,我会将此作为评论而不是答案发布)