int rf_load_key_hex(int icdev,unsigned char _Mode,unsigned char _SecNr,char *_NKey);功 能:向读写器中装入十六进制密码参 数:icdev:通讯设备标识符 _Mode:密码验证模式 _SecNr:扇区号(0~15) _Nkey:写入读写器中的卡密码返 回:成功则返回 0int rf_card(int icdev,unsigned char _Mode,unsigned long *_Snr);功 能:寻卡,能返回在工作区域内某张卡的序列号参 数:icdev:通讯设备标识符 _Mode:寻卡模式mode_card _Snr:返回的卡序列号返 回:成功则返回 0[DllImport("mwrf32.dll",EntryPoint = "rf_load_key_hex",SetLastError = true,CharSet = CharSet.Ansi,ExactSpelling = true,CallingConvention = CallingConvention.StdCall)]public static extern int rf_load_key_hex(int icdev,int Mode,int SecNr,string nKey);
if(rf_load_key_hex(icdev,0,0,"FFFFFFFFFFFF")==0) 为何返回值一直得不到0
还有rf_card应该如何写,请各位帮忙看看
if(rf_load_key_hex(icdev,0,0,"FFFFFFFFFFFF")==0) 为何返回值一直得不到0
还有rf_card应该如何写,请各位帮忙看看
int rf_card(int icdev,byte _Mode,byte[] _Snr);
试了[DllImport("mwrf32.dll",EntryPoint = "rf_load_key_hex",SetLastError = true,CharSet = CharSet.Ansi,ExactSpelling = true,CallingConvention = CallingConvention.StdCall)]public static extern int rf_load_key_hex(int icdev,byte Mode,byte SecNr,string nKey);
不能得到0
public static extern int rf_load_key_hex(int icdev, byte _Mode, byte _SecNr, System.IntPtr _NKey) ;
[System.Runtime.InteropServices.DllImportAttribute("mwrf32.dll", EntryPoint="rf_card")]
public static extern int rf_card(int icdev, byte _Mode, ref uint _Snr) ;
再调用rf_load_key_hex()http://topic.csdn.net/t/20060406/12/4667154.html
[DllImport("mwrf32.dll")]
public static extern short rf_card(int icdev, int mode, ref int Snr);
调用:
int cardmode=1;
retcode = CRF35.rf_card(icdev, cardmode,ref Snrl);
试了[DllImport("mwrf32.dll",EntryPoint = "rf_load_key_hex",SetLastError = true,CharSet = CharSet.Ansi,ExactSpelling = true,CallingConvention = CallingConvention.StdCall)]public static extern int rf_load_key_hex(int icdev,byte Mode,byte SecNr,string nKey);
不能得到0
HANDLE void* System.IntPtr 32 位
BYTE unsigned char System.Byte 8 位
SHORT short System.Int16 16 位
WORD unsigned short System.UInt16 16 位
INT int System.Int32 32 位
UINT unsigned int System.UInt32 32 位
LONG long System.Int32 32 位
BOOL long System.Int32 32 位
DWORD unsigned long System.UInt32 32 位
ULONG unsigned long System.UInt32 32 位
CHAR char System.Char 用 ANSI 修饰。
LPSTR char* System.String 或 System.StringBuilder 用 ANSI 修饰。
LPCSTR Const char* System.String 或 System.StringBuilder 用 ANSI 修饰。
LPWSTR wchar_t* System.String 或 System.StringBuilder 用 Unicode 修饰。
LPCWSTR Const wchar_t* System.String 或 System.StringBuilder 用 Unicode 修饰。
FLOAT Float System.Single 32 位
DOUBLE Double System.Double 64 位
http://topic.csdn.net/t/20040816/11/3278042.html
public static extern int rf_load_key_hex(int icdev,byte Mode,byte SecNr,string NKey);
我使用rf_load_key_hex(icdev,0,1,"FFFFFFFFFFFF") 无法返回0
但是我用rf_load_key_hex(icdev,0,1,"000000000000") 能返回0,
应该是两者都返回0才正确,请指点一下
再调用rf_load_key_hex()
NKey的类型是StringBuilder
不行?