Page 1 of 1

Ayuda con codigo C

PostPosted: Thu Mar 11, 2021 12:13 am
by csincuir
Hola a todos.
Quiero molestarles ahora, si alguien sabe como poder usar este codigo C con FWH por favor:

Code: Select all  Expand view
--------------------------------------------------------------
| Codigo para lectura / registro de la huella
|
--------------------------------------------------------------

#include <iostream>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <fstream>

using namespace std;

int main(int argc, char *argv[])
{
    string resultado = "";

    if(argc==1)
    {
        resultado = system("biometrico\\bspdemo_cs.exe  adndigital2021");
        ifstream file("biometrico\\biometricohuella.txt");
        string content;

        //--------------------------------------
        // Lee el resultado del archivo
        // La huella leida por el biometrico
        //--------------------------------------
        while(file >> content)
        {
            cout << content << ' ';
        }

    }

    return 0;
}


--------------------------------------------------------------
| Codigo para comparar la huella contra una ya registrada
|
--------------------------------------------------------------

#include <iostream>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <fstream>

using namespace std;

int main(int argc, char *argv[])
{
    string resultado = "";

    if(argc==2)
    {
        std::string cmd = "biometrico\\bspdemo_cs.exe  adndigital2021";

        //
        // argv[1] --> contiene el string de la huella a comparar
        //
        cmd += argv[1];

        resultado = system(cmd.c_str());

        ifstream file("biometrico\\biometricoresultado.txt"); string content;

        //--------------------------------------
        // Lee el resultado del archivo
        // Matched
        // Not Matched
        //--------------------------------------
        while(file >> content)
        {
            cout << content << ' ';
        }
    }

    return 0;
}


Gracias anticipadas.

Carlos

Re: Ayuda con codigo C

PostPosted: Thu Mar 11, 2021 8:04 am
by Antonio Linares
Carlos,

Prueba asi:

WinExec( "biometrico\\bspdemo_cs.exe adndigital2021" )
MsgInfo( MemoRead( "biometrico\\biometricohuella.txt" ) )

Re: Ayuda con codigo C

PostPosted: Thu Mar 11, 2021 12:20 pm
by csincuir
Antonio, gracias por tu respuesta.
Yo hago las pruebas y comento luego.
Este es un requerimiento de un cliente, que quiere utilizar los lectores biométricos Hamster IV

Saludos cordiales.

Carlos