vs2008 USB转COM口发送字符中途出错的问题.
在VS2008中,使用USB轉串口發送字符,當拔下設備再插上,串口在使用的途中會拋出錯誤,用Try..Catch都無法捕獲.
在 System.UnauthorizedAccessException 中第一次偶然出現的“System.dll”類型的異常
“Gosun.SMC.SMS.WindowService.exe”(托管): 已加載“C:"Windows"assembly"GAC_MSIL"System.Transactions.resources"2.0.0.0_zh-CHS_b77a5c561934e089"System.Transactions.resources.dll”
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>未處理的異常</Description><AppDomain>Gosun.smc.sms.windowservice.exe</AppDomain><Exception><ExceptionType>System.UnauthorizedAccessException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>對端口的訪問被拒絕。</Message><StackTrace>?? 在 System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
?? 在 System.IO.Ports.InternalResources.WinIOError()
?? 在 System.IO.Ports.SerialStream.Dispose(Boolean disposing)
?? 在 System.IO.Ports.SerialStream.Finalize()</StackTrace><ExceptionString>System.UnauthorizedAccessException: 對端口的訪問被拒絕。
?? 在 System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
?? 在 System.IO.Ports.InternalResources.WinIOError()
?? 在 System.IO.Ports.SerialStream.Dispose(Boolean disposing)
?? 在 System.IO.Ports.SerialStream.Finalize()</ExceptionString></Exception></TraceRecord>
這應該是serialport的一個Bug!!
轉載于:https://www.cnblogs.com/anqincmt/archive/2008/08/13/1266907.html
總結
以上是生活随笔為你收集整理的vs2008 USB转COM口发送字符中途出错的问题.的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: EasyCVR接入Ehome协议设备PS
- 下一篇: 如何使用spy ++ (How to u