Ejemplo n.º 1
0
        public static Commprop GetComPortProperties(string portName)
        {
            var    commProp = new Commprop();
            IntPtr hFile    = CreateFile(@"\\.\" + portName, 0, 0, IntPtr.Zero, 3, 0x80, IntPtr.Zero);

            GetCommProperties(hFile, ref commProp);
            CloseHandle(hFile);
            return(commProp);
        }
Ejemplo n.º 2
0
 static extern bool GetCommProperties(IntPtr hFile, ref Commprop lpCommProp);