嗨我在调用GetSerialPorts()方法时遇到异常。
Hi I am getting exception when I call GetSerialPorts() method.
Exception Messagge:没有更多数据可用。
Exception Messagge: No more data is available.
堆栈跟踪:
at Microsoft.Win32.RegistryKey.Win32Error(int32 errorCode,string str)
at Microsoft.Win32.RegistryKey.Win32Error(int32 errorCode, string str)
at Microsoft.Win32.RegistryKey.GetValueNames()
at Microsoft.Win32.RegistryKey.GetValueNames()
在System.IO.Ports.SerialPort.GetPortNames()
at System.IO.Ports.SerialPort.GetPortNames()
................ ..........................................
..........................................................
任何想法。请帮帮我。
推荐答案
也许您应该向我们展示您正在使用的代码。
Perhaps you should show us the code you are using.
以下是否适用于您?
string [] ports = SerialPort.GetPortNames(); foreach( string port in ports ) { Console.WriteLine( port ); }Andy
Andy
更多推荐
System.IO.Ports.SerialPort.GetSerialPorts()抛出异常
发布评论