c语言的DLL怎么转为C#(高手啊,帮帮忙吧)
有一个才语言编写的DLL,但是我不知道怎么使用c#条用,麻烦大家帮帮忙,不胜感激!一下是c语言写的 接口定义,但是 如果用c#的话,应该怎么写!
(1) int OpenPort(int com, long baud)
(2) int ClosePort(unsigned int com)
⑴ int HotResetPinpad(void)
⑵ int ResetPinpad(void)
(3) int ClearScreen(void)
(4) int SetSCLength(unsigned int len)
(3) int SetSCLength_Max(unsigned int len)
(4) int ActiveWorkKey(unsigned int m,unsigned int n)
(5) int ModifyWorkKey(unsigned int m,unsigned int n,unsigned char* MKey,unsigned char* WKey)
(6) int ModifyMKey(unsigned int m,unsigned char* Old_MKey,unsigned char* New_MKey)
(7)int ModifyWorkKey_S(unsigned int m,unsigned int n,unsigned char* SCbuff)
(8)int Cal_MAC(unsigned int m,unsigned char* SCbuff,unsigned int len, unsigned char* MACbuff)
(9)int Get_Pin(unsigned int m,unsigned int len, unsigned char* SCbuff)
(10) int Get_Pin_I(unsigned int m,unsigned int len, unsigned char *CardNo,unsigned char* SCbuff)
(11) int NL_GetPin(int portNo,unsigned int m,unsigned int Mtime,unsigned int* len, unsigned char* SCbuff);
(12) int STAR_GetPin(int portNo,unsigned int m,unsigned int Mtime,unsigned int* len, unsigned char* SCbuff);
谢谢大家了! --------------------编程问答-------------------- 是否可以使用API的调用方式 --------------------编程问答-------------------- DLLImport --------------------编程问答-------------------- 通过这些接口函数的名字看出,你是在使用USBkey,还是找厂家直接提供吧 --------------------编程问答-------------------- 我也想知道。 --------------------编程问答-------------------- 学习 --------------------编程问答--------------------
--------------------编程问答-------------------- DLLImport
[DllImport("test.dll")]
public static extern int OpenPort (int com, int baud);
[DllImport("test.dll")]
public static extern int ClosePort (uint com);
[DllImport("test.dll")]
public static extern int HotResetPinpad ();
[DllImport("test.dll")]
public static extern int ResetPinpad ();
[DllImport("test.dll")]
public static extern int ClearScreen ();
[DllImport("test.dll")]
public static extern int SetSCLength (uint len);
[DllImport("test.dll")]
public static extern int SetSCLength_Max (uint len);
[DllImport("test.dll")]
public static extern int ActiveWorkKey (uint m, uint n);
[DllImport("test.dll")]
public static extern int ModifyWorkKey (uint m, uint n, ref byte MKey, ref byte WKey);
[DllImport("test.dll")]
public static extern int ModifyMKey (uint m, ref byte Old_MKey, ref byte New_MKey);
[DllImport("test.dll")]
public static extern int ModifyWorkKey_S (uint m, uint n, ref byte SCbuff);
[DllImport("test.dll")]
public static extern int Cal_MAC (uint m, ref byte SCbuff, uint len, ref byte MACbuff);
[DllImport("test.dll")]
public static extern int Get_Pin (uint m, uint len, ref byte SCbuff);
[DllImport("test.dll")]
public static extern int Get_Pin_I (uint m, uint len, ref byte CardNo, ref byte SCbuff);
[DllImport("test.dll")]
public static extern int NL_GetPin (int portNo, uint m, uint Mtime, ref uint len, ref byte SCbuff);
[DllImport("test.dll")]
public static extern int STAR_GetPin (int portNo, uint m, uint Mtime, ref uint len, ref byte SCbuff);
补充:.NET技术 , C#