如何使用c#在基于gsm moden的应用程序中识别com端口号 [英] how to identify com port numbers in gsm moden based application using c#
本文介绍了如何使用c#在基于gsm moden的应用程序中识别com端口号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在c#中识别基于调制解调器的消息传递中的COM端口?
解决方案
将以下指令添加到项目中:
< pre lang =cs> 使用 System.IO;
使用 System.IO.Ports;
使用与此类似的功能可以检索列表中的可用端口。
public string [] findPorts()
{
// 创建和返回带端口名称的字符串数组。
string [] foundPorts = SerialPort.GetPortNames();
return foundPorts;
}
how to identify a com port in modem based messaging in c#?
解决方案
Add the following directives to your project:
using System.IO; using System.IO.Ports;
Use a function similar to this to retreive a list the available ports.
public string[] findPorts() { // Creates and returns a string array with port names. string[] foundPorts = SerialPort.GetPortNames(); return foundPorts; }
这篇关于如何使用c#在基于gsm moden的应用程序中识别com端口号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文