public void Config_NetworkGet() { string ip; string netmask; string gateway; UInt16 porta; if (rep.LerConfigRede(out ip, out netmask, out gateway, out porta)) { Console.WriteLine("IP: " + ip); Console.WriteLine("Netmask: " + netmask); Console.WriteLine("Gateway: " + gateway); Console.WriteLine("Porta: " + porta); } else { Assert.Fail("Erro ao ler configurações de rede"); } }
private void load_DoWork(object sender, DoWorkEventArgs e) { try { if (_rep != null) { // Data e Hora atual int ano, mes, dia, hora, minuto, segundo; if (!_rep.LerDataHora(out ano, out mes, out dia, out hora, out minuto, out segundo)) { ano = mes = dia = hora = minuto = segundo = 0; } cData = new DateTime(ano, mes, dia, hora, minuto, segundo).ToString("dd/MM/yyyy HH:mm:ss"); // Horario de Verão _rep.LerConfigHVerao(out hVeraoIAno, out hVeraoIMes, out hVeraoIDia, out hVeraoFAno, out hVeraoFMes, out hVeraoFDia); // Empregador _rep.LerEmpregador(out emp_doc, out emp_tipodoc, out emp_cei, out emp_razsoc, out emp_end); // Ethernet _rep.LerConfigRede(out eth_ip, out eth_nmask, out eth_gw, out eth_port); cInfo = "OK"; } else { throw new Exception("Erro ao conectar-se com o REP"); } } catch (Exception ex) { cInfo = "ERRO: \r\n" + ex.Message; } }