I have device (TCP/IP network controller) which is connect to my network router. To that controller is connected fingerprint scanner. What i want to do is get data of scanned finger into my c# code.
I have tried using TCP Listner but nothing happened (no error or anything lese)
I have dll
file from that product but there are lot of code in it and i am new to this so i overlooked something. Inside that dll
i tried searching for some EventHandler
(thought that is listening or responding when finger is placed on scanner) but there is not even one of it.
What should i look for or how should i listen to data that get's sent from that device.
Here is DLL File: Download Link
I know this may be too broad but please give me some hints, i am trying this for few days and still can't figure it out.
Code i tried:
namespace ConsoleApplication1
{
public class Program
{
static void Main(string[] args)
{
TcpListener server = null;
try
{
// Set the TcpListener on port 60000.
Int32 port = 60000;
// TcpListener server = new TcpListener(port);
server = new TcpListener(port);
// Start listening for client requests.
server.Start();
// Buffer for reading data
Byte[] bytes = new Byte[256];
String data = null;
// Enter the listening loop.
while (true)
{
Console.Write("Waiting for a connection... ");
// Perform a blocking call to accept requests.
// You could also user server.AcceptSocket() here.
TcpClient client = server.AcceptTcpClient();
Console.WriteLine("Connected!");
data = null;
// Get a stream object for reading and writing
NetworkStream stream = client.GetStream();
int i;
// Loop to receive all the data sent by the client.
while ((i = stream.Read(bytes, 0, bytes.Length)) != 0)
{
// Translate data bytes to a ASCII string.
data = System.Text.Encoding.ASCII.GetString(bytes, 0, i);
Console.WriteLine("Received: {0}", data);
// Process the data sent by the client.
data = data.ToUpper();
byte[] msg = System.Text.Encoding.ASCII.GetBytes(data);
// Send back a response.
stream.Write(msg, 0, msg.Length);
Console.WriteLine("Sent: {0}", data);
}
// Shutdown and end connection
client.Close();
}
}
catch (SocketException e)
{
Console.WriteLine("SocketException: {0}", e);
}
finally
{
// Stop listening for new clients.
server.Stop();
}
Console.WriteLine("\nHit enter to continue...");
Console.Read();
}
}
}
Product i am having: LINK
Couldn't find any documentation for it.