[DllImport("SunIDApi.dll", CharSet=CharSet.Ansi)] [return: MarshalAs(UnmanagedType.LPArray)]public static extern byte[] FPgetCodeText(int SensorHandle, int errorCode); 这个不太肯定,如果不行就只能用IntPtr,然后通过System.Runtime.InteropServices.Marshal类来操作了。 public static extern IntPtr FPgetCodeText(int SensorHandle, int errorCode);[DllImport("SunIDApi.dll", CharSet=CharSet.Ansi)] public static extern int FPsaveFinger(byte[] lpFinger, [MarshalAs(UnmanagedType.LPStr)]string lpszFileName);[DllImport("SunIDApi.dll", CharSet=CharSet.Ansi)] public static extern int FPreadFinger([MarshalAs(UnmanagedType.LPStr)]string lpszFileName, byte[] lpFinger, ref int lpWidth, ref int lpHeight);[DllImport("SunIDApi.dll", CharSet=CharSet.Ansi)] public static extern int FPextractTemplate(byte[] Image, int Resolution, byte[] lpFeature, ref int lpSize);[DllImport("SunIDApi.dll", CharSet=CharSet.Ansi)] public static extern int FPmatch(byte[] lpFeature1, byte[] lpFeature2, ref int lpScore, bool FastMode);[DllImport("SunIDApi.dll", CharSet=CharSet.Ansi)] public static extern int FPgetQuality(byte[] lpFinger, ref int pScore);
[return: MarshalAs(UnmanagedType.LPArray)]public static extern byte[] FPgetCodeText(int SensorHandle, int errorCode);
这个不太肯定,如果不行就只能用IntPtr,然后通过System.Runtime.InteropServices.Marshal类来操作了。
public static extern IntPtr FPgetCodeText(int SensorHandle, int errorCode);[DllImport("SunIDApi.dll", CharSet=CharSet.Ansi)]
public static extern int FPsaveFinger(byte[] lpFinger, [MarshalAs(UnmanagedType.LPStr)]string lpszFileName);[DllImport("SunIDApi.dll", CharSet=CharSet.Ansi)]
public static extern int FPreadFinger([MarshalAs(UnmanagedType.LPStr)]string lpszFileName, byte[] lpFinger, ref int lpWidth, ref int lpHeight);[DllImport("SunIDApi.dll", CharSet=CharSet.Ansi)]
public static extern int FPextractTemplate(byte[] Image, int Resolution, byte[] lpFeature, ref int lpSize);[DllImport("SunIDApi.dll", CharSet=CharSet.Ansi)]
public static extern int FPmatch(byte[] lpFeature1, byte[] lpFeature2, ref int lpScore, bool FastMode);[DllImport("SunIDApi.dll", CharSet=CharSet.Ansi)]
public static extern int FPgetQuality(byte[] lpFinger, ref int pScore);