-->

Asp.net webservice: prompt for finger print reader

2019-06-13 16:03发布

问题:

I am using mootools library to call webservices in an asp.net application. one of the web services is used to create new users in the database. I create an html dialog with mootools where the user can input his details, username, password, etc etc. upon submitting, the web service is called. We have a fingerprint scanner with a .net SDK. Is it possible for me to prompt the user for the finger print inside the webservice just before saving the details the user inputted in the html dialog?

Please note that the finger print scanner and the asp app will be available on one computer so to create new accounts users will go near the admins using this pc.

I am thinking of something like the below:

[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string NewMember(parameters)
{
    JavaScriptSerializer js = new JavaScriptSerializer();
    try
    {
        Database db = new Database();
        //Prompt and get finger print from user

        //create user
        db.CreateNewMember(parameters with finger print code)

Thanks

回答1:

No. You cannot use a web service to invoke your fingerprint reader directly. You'll need something client side (javascript/mootools/activex) to handle that.



回答2:

One option (not too good) is if you can create a WPF/WinForms application using that fingerprint SDK and invoke that application from your WebService as you described above. For example:

  1. insert user details into the database
  2. execute your finger print reader app with user id as an argument
  3. wait until finishes the job (scan/save fingerprint data to a temporary place with user id)
  4. update your database record with the fingerprint details (read then delete from the temp place)

Or better if you just insert your user details into the database with empty fingerprint data using your WebService. Then later update your users record with fingerprint data using an independent WPF/WinForms application with direct DB access as it is won't block your WebService.



回答3:

I asked this question before having the finger print at hand. Now that I have the finger print scanner at hand and used it with C# I realized that I do not need to store any finger print id in the database. the finger print scanner stores everything in it memory it just returns and id for the user.

I am going to create a windows app with c# for finger print events, from those events I get the id of the user which will match that in the database and from the app I will open or close the gate so practically no need to have it in the web app which is used to manage users only. When a new user is created on the web app I will show the id to the admin so he can add a finger print with same id to the user.