12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.IO.Ports;
- namespace FileWatcher
- {
- public partial class SerialPortCombox : UserControl
- {
- public SerialPortCombox()
- {
- InitializeComponent();
- }
- public override string Text
- {
- get
- {
- return ComCombox.Text;
- }
- set
- {
- ComCombox.Text = value;
- }
- }
- private void SerialPortCombox_Load(object sender, EventArgs e)
- {
- string[] str= SerialPort.GetPortNames();
- for (int i = 0; i < str.Length; i++)
- {
- Console.WriteLine(str[i]);
- }
- ComCombox.Items.AddRange(SerialPort.GetPortNames());
- }
- }
- }
|