我现在做考勤系统,要用到别人考勤机的.dll文件,从考勤机里取出原始打卡记录,请问各位在C#里怎么操作?

解决方案 »

  1.   

    it is easy.
    the *.dll is a com, you can add it as a referrence  to your project.
    Note: when you deploy your application, you must install com to computer too
      

  2.   

    if *.dll isn't com ,how can I do?
      

  3.   

    如果你的dll文件是用.net 开发的,直接按楼上所回答的操作即可,如果你的dll文件是别的语音比如是win32 的标准开发的,不是com 但如果是标准的dll,可以采用pinvoke 方法来处理,具体你可以搜索一下pinvoke 的应用,应该很多的,祝愿你好运
      

  4.   


    比如如下:
    [DllImport("user.dll", SetLastError = true)]
            static extern uint GetWindowThreadProcessId(IntPtr hWnd, out int lpdwProcessId);
      

  5.   

    两种方法:
    DllImport或包装成COM组件,COM组件通用性更好但是使用复杂。
      

  6.   

    在 C# 中通过 P/Invoke 调用Win32 DLL
    http://www.microsoft.com/china/msdn/library/langtool/vcsharp/ousNET.mspx