public static int Use2(string numero, string rutaFoto, string archivoSalida) { int ret = Jpt.OK; Jpt.SetField("documentno", numero); ret = Jpt.Code2File(rutaFoto, "", archivoSalida); if (ret != Jpt.OK) { MessageBox.Show(Jpt.Error(ret), "JPT Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } return(ret); }
public static void Main() { try { Jpt.Start("jpt.ini"); // do this once on app start Jpt.Use(); // do this for each document Jpt.End(); // do this once on app end } catch (Exception ex) { MessageBox.Show(ex.Message, "JPT Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
public static void Main() { try { Jpt.Start("jpt.ini"); // do this once on app start Jpt.Use2("1234567890", @"C:\Users\SSP\Downloads\Debug\fotoHector.jpg", @"C:\Users\SSP\Downloads\Debug\foto.jpg"); // do this for each document Jpt.End(); // do this once on app end } catch (Exception ex) { MessageBox.Show(ex.Message, "JPT Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void iniciarServer() { Jpt.Start("jpt.ini"); // setTexto("Servidor iniciado"); int ret = Jura.Jura.getCountLicence(); ret = Jura.Jura.init("jpt.ini"); if (ret == 0) { ret = Jura.Jura.getExpiryDate(); string fecha = ret.ToString(); setTexto("Servidor iniciado. Licencias Disponibles: " + Jura.Jura.getCountLicence() + ", fecha expiración: " + fecha.Substring(0, 4) + "-" + fecha.Substring(4, 2) + "-" + fecha.Substring(6, 2)); } }
public static int Use(string numero, string apellidos, string nombre, DateTime fechaNacimiento, string nacionalidad, DateTime fechaVigencia, string sexo, string MRZ, string rutaFoto, int idPersona, string archivoSalida) { int ret = Jpt.OK; Jpt.SetField("documentno", numero); Jpt.SetField("surname", apellidos); Jpt.SetField("givenname", nombre); Jpt.SetField("birthdate", fechaNacimiento.ToString("yyMMdd")); Jpt.SetField("birthplace", nacionalidad); Jpt.SetField("dateexpiry", fechaVigencia.ToString("yyMMdd")); Jpt.SetField("sex", sexo); Jpt.SetField("ocr", MRZ); ret = Jpt.Code2File(rutaFoto, "", archivoSalida); return(ret); //if (ret != Jpt.OK) // MessageBox.Show(Jpt.Error(ret), "JPT Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); }
public static void Start(String inifilename) { int ret = Jpt.OK; try { ret = Jpt.ReadIni(inifilename); } catch (Exception DllNotFoundException) { throw new Exception("Could not load JPT.DLL\nHardware key missing or software not installed properly."); } if (ret != Jpt.OK) { Jpt.CleanUp(); throw new Exception(Jpt.Error(ret)); } }
public static void Use() { int ret = Jpt.OK; Jpt.SetField("documentno", "JU155483"); Jpt.SetField("surname", "SINGER"); Jpt.SetField("givenname", "VICTORIA"); Jpt.SetField("birthdate", "791203"); Jpt.SetField("birthplace", "Jurio"); Jpt.SetField("dateexpiry", "170502"); Jpt.SetField("sex", "F"); Jpt.SetField("ocr", "P<JURSINGER<<VICTORIA<<<<<<<<<<<<<<<<<<<<<<<\r\nJU155483<3JUR8709136F1602113<<<<<<<<<<<<<<00"); ret = Jpt.Code2File("http://motd.mx/Licencias2/html/images/persona/chavo.jpg", "", "LS.BMP"); if (ret != Jpt.OK) { MessageBox.Show(Jpt.Error(ret), "JPT Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
public static void End() { Jpt.CleanUp(); }
private void frmEstatus_FormClosed(object sender, FormClosedEventArgs e) { Jpt.End(); }
private void buscarSolicitudes() { timer1.Stop(); int ret = 0; string strContribuyente = string.Empty; try { foreach (clsMicrotexto item in objMicrotexto.getSolicitudes()) { strContribuyente = "IdPersona: " + item.idPersona + ", Nombre: " + item.apellidos + " " + item.nombre + ", Licencia: " + item.numeroLicencia; setTexto("Procesando solicitud idPersona = " + item.idPersona + " " + item.nombre + " " + item.apellidos); string nombreFoto = string.Empty; try { using (pbImagen = new PictureBox()) { pbImagen.Load(ConfigurationManager.AppSettings["SistemaURL"] + "html/" + item.URLfoto); nombreFoto = "Foto_Temp_" + item.idMicrotexto + ".jpg"; Image Imgtemp = pbImagen.Image; Imgtemp.Save(nombreFoto); } } catch (Exception ex) { item.Actualizar(true); if (ex.Message.Contains("Error genérico en GDI+")) { Application.Restart(); } else { throw ex; } } item.rutaLocalFoto = nombreFoto; item.nombreArchivoSalida = "LS_" + item.idPersona + ".BMP"; int contador = 1; while (File.Exists(item.nombreArchivoSalida)) { item.nombreArchivoSalida = "LS_" + item.idPersona + "(" + contador + ").BMP"; contador++; } ret = Jpt.Use(item.numeroLicencia, item.apellidos, item.nombre, item.fechaNacimiento, item.nacionalidad, item.fechaVigencia, item.sexo, item.MRZ, item.rutaLocalFoto, item.idPersona, item.nombreArchivoSalida); if (ret == 0) { if (uploadImagen(item)) { item.Actualizar(); setTexto(item.bError ? item.Error + " " + item.SystemError : "Solicitud procesada correctamente. Licencias Disponibles: " + Jura.Jura.getCountLicence()); } else { setTexto("Error al cargar el archivo."); } } //else if(ret ==8) //{ // item.Actualizar(true); // setTexto("Error " + ret + "-" + Jpt.Error(ret)); // //setTexto(item.bError ? item.Error + " " + item.SystemError : "Solicitud procesada correctamente"); //} else { item.Actualizar(true); setTexto("Error " + ret + " - " + Jpt.Error(ret)); System.IO.File.WriteAllText(Application.StartupPath + "\\log\\" + DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss") + ".txt", DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss") + " - " + Jpt.Error(ret) + "\n" + strContribuyente); } } } catch (Exception ex) { setTexto(ex.Message + " " + ex.StackTrace); System.IO.File.WriteAllText(Application.StartupPath + "\\log\\" + DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss") + ".txt", DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss") + " - " + ex.Message + " " + ex.StackTrace + "\n" + strContribuyente); //if (ex.Message.Contains("Error genérico en GDI+")) //{ //} } timer1.Start(); }