Pergunta

I had recently bought a fingerprint cum card reader machine. And with it came the API so that i may use it through network from my pc. The problem is that i am building application based on C#.net and the api documentation says build on vb. Secondly i am not able to include and use it in my C# application.

Kindly try it and tell me how to use it on my c# application.The complete api rar file is linked below. Kindly download it nd help

link: http://www.4shared.com/rar/TfD6vyOdce/SDK.html

Foi útil?

Solução

First Option is:

Add the DLL via the solution explorer - right click on references --> 
add reference then "Browse" to you DLL - then it should be available.

Second, option is : //Unmanaged C++ dll example:

using System;
using System.Runtime.InteropServices;

//You may need to use DllImport

[DllImport(@"C:\Cadence\SPB_16.5\tools\bin\mpsc.dll")]
static extern void mpscExit();

//or

[DllImport("user32.dll", CharSet = CharSet.Unicode)]
    public static extern int MessageBox(IntPtr hWnd, String text, String caption, uint type);

//Then each of those are called like this:

mpscExit();  // a specific DLL method/function call 
MessageBox(new IntPtr(0), "Test", "Test Dialog", 0);  

// user32.dll is Microsoft, path not nee

small exapmle in console application

using System;
using System.Runtime.InteropServices;     // DLL support

class HelloWorld
{
    [DllImport("TestLib.dll")]
    public static extern void DisplayHelloFromDLL ();

    static void Main ()
    {
        Console.WriteLine ("This is C# program");
        DisplayHelloFromDLL ();
    }
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top