SerialPort sp = new SerialPort();该如何处理
SerialPort sp = new SerialPort();
用完后,怎么样正确释放资源。
有时候关闭不正常,端口还被占用着,下次就打不开。
------解决方案--------------------
refer: http://msdn.microsoft.com/zh-cn/library/system.io.ports.serialport.aspx
------解决方案--------------------
调用Close方法
用完后,怎么样正确释放资源。
有时候关闭不正常,端口还被占用着,下次就打不开。
------解决方案--------------------
refer: http://msdn.microsoft.com/zh-cn/library/system.io.ports.serialport.aspx
------解决方案--------------------
调用Close方法