Ejemplo n.º 1
0
        public virtual CONN_TYPE ConnectionType()
        {
            byte[] ipAddr;
            System.Net.IPAddress ipA;
            string sPathASync = @"HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts\ppp_peer";

            string[]  aAdNames = { "WiFi" };
            CONN_TYPE eCType   = CONN_TYPE.NOCONNECTIONS;

            //RegistryKey rk = Registry.LocalMachine;

            /*
             *          try
             *          {
             *              ipList = System.Net.Dns.GetHostEntry("PPP_PEER");
             *              eCType = CONN_TYPE.ACTIVESYNC;
             *          }
             *          catch
             *          {
             *              ipList = new System.Net.IPHostEntry();
             *
             *          }
             *          if ((ipList.AddressList != null)&&(ipList.AddressList.Length > 0))
             *              ret = ipList.AddressList[0].ToString();
             *
             */
            if (GetIP())
            {
                ipAddr = (byte[])Registry.GetValue(sPathASync, "ipaddr", new byte[] { });
                if ((ipAddr != null) && (ipAddr.Length == 4))
                {// ASync present
                    ipA    = new System.Net.IPAddress(ipAddr);
                    eCType = CONN_TYPE.ACTIVESYNC;
                }
                else
                {
                    eCType = CONN_TYPE.WIFI;
                }
            }
            return(eCType);
        }
Ejemplo n.º 2
0
 public DTP_HM(SerialPort printerPort)
 {
     this.PRINTER_PORT = printerPort;
     this.PRINTER_TYPE = CONN_TYPE.serial;
 }
Ejemplo n.º 3
0
 public DTP_HM(string printerName)
 {
     this.PRINTER_NAME = printerName;
     this.PRINTER_TYPE = CONN_TYPE.usb;
 }