_Serial.cs 727 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Diagnostics;
  6. using System.IO.Ports;
  7. namespace IControls_FireManager
  8. {
  9. // 시리얼 통신부에 관련된 루틴은 여기에서 구현한다
  10. public static class _Serial
  11. {
  12. // 현재 컴퓨터의 포트 정보를 Data1;Data2;Data3 순으로 표현한다
  13. public static string MyPort()
  14. {
  15. string result = null;
  16. string[] ports = SerialPort.GetPortNames();
  17. foreach (string port in ports)
  18. result = result + port + _Text.SemiColon;
  19. result = result.TrimEnd(_Convert.Split_Key);
  20. return result;
  21. }
  22. }
  23. }