感谢Sunny秋刀鱼。https://www.cnblogs.com/527289276qq/p/5595798.html 在页面或者窗口Unloaded事件中关闭串口即可。 转载于:https://www.cnblogs.com/dotnetHui/p/8513592.html