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); }
public DTP_HM(SerialPort printerPort) { this.PRINTER_PORT = printerPort; this.PRINTER_TYPE = CONN_TYPE.serial; }
public DTP_HM(string printerName) { this.PRINTER_NAME = printerName; this.PRINTER_TYPE = CONN_TYPE.usb; }