Created
July 21, 2015 03:55
-
-
Save Fhernd/4344a54c9d849f260a09 to your computer and use it in GitHub Desktop.
Uso del método static SerialPort.GetPortNames para obtener los nombres de los puertos seriales del equipo local.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OrtizOL - xCSw - http://ortizol.blogspot.com | |
using System; | |
using System.IO.Ports; | |
namespace Receta.CSharp.R0520 | |
{ | |
public class UsoGetPortNames | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine(Environment.NewLine); | |
// Obtiene la lista de los nombres de los puertos | |
// seriales del equipo local: | |
string[] puertos = SerialPort.GetPortNames(); | |
Console.WriteLine("Puertos disponibles:"); | |
foreach(string puerto in puertos) | |
{ | |
Console.WriteLine("\t{0}", puerto); | |
} | |
Console.WriteLine(Environment.NewLine); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment