明华澳汉 sle_4442 卡 读写

None.gif using  System;
None.gif
using  System.Text ;
None.gif
using  System.Runtime.InteropServices;
None.gif
None.gif
namespace  Fit.Dg.Client
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
ExpandedSubBlockStart.gifContractedSubBlock.gif
/**//// <summary>
InBlock.gif
/// IC4442 的摘要说明。
ExpandedSubBlockEnd.gif
/// </summary>

InBlock.gif public class IC4442:IC
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif
public IC4442()
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif
//
InBlock.gif
// TODO: 在此处添加构造函数逻辑
InBlock.gif
//
ExpandedSubBlockEnd.gif
}

InBlock.gif
InBlock.gif[DllImport(
"Mwic_32.dll", EntryPoint="swr_4442",  SetLastError=true,
InBlock.gif CharSet
=CharSet.Auto, ExactSpelling=false
InBlock.gif CallingConvention
=CallingConvention.StdCall)]
InBlock.gif
//说明:    向指定地址写数据
InBlock.gif
//调用:    icdev:    通讯设备标识符  offset:   偏移地址,其值范围0~255
InBlock.gif
//          len:      字符串长度,其值范围1~256w_string: 写入数据  [MarshalAs(UnmanagedType.LPArray)] byte[] StringBuilder
InBlock.gif
//返回:     <0   错误 =0  正确
InBlock.gif
 public static extern int Swr_4442(int icdev, int offset, int len, [MarshalAs(UnmanagedType.LPArray)] byte[]  w_string);
InBlock.gif
InBlock.gif[DllImport(
"Mwic_32.dll", EntryPoint="srd_4442",  SetLastError=true,
InBlock.gif  CharSet
=CharSet.Auto, ExactSpelling=false
InBlock.gif  CallingConvention
=CallingConvention.StdCall)]
InBlock.gif
//说明:    从指定地址读数据  
InBlock.gif
//   调用:    icdev:    通讯设备标识符 offset:   偏移地址,其值范围0~255
InBlock.gif
//  len:      字符串长度,其值范围1~256  r_string: 读出数据所存放地址指针
InBlock.gif
//返回:     <>0   错误 =0 正确
InBlock.gif
public  static extern  int Srd_4442(int icdev, int offset, int len,[MarshalAs(UnmanagedType.LPArray)] byte[] r_string ); 
InBlock.gif
InBlock.gif
InBlock.gif[DllImport(
"Mwic_32.dll", EntryPoint="chk_4442",  SetLastError=true,
InBlock.gif CharSet
=CharSet.Auto , ExactSpelling=false,
InBlock.gif CallingConvention
=CallingConvention.StdCall)]
InBlock.gif
//说明:    检查卡型是否正确  
InBlock.gif
//调用:    icdev:   通讯设备标识符 
InBlock.gif
//返回:     <0   错误   =0   正确
InBlock.gif
public static extern  int Chk_4442(int icdev);
InBlock.gif
InBlock.gif
InBlock.gif[DllImport(
"Mwic_32.dll", EntryPoint="csc_4442",  SetLastError=true,
InBlock.gif CharSet
=CharSet.Auto, ExactSpelling=true,
InBlock.gif CallingConvention
=CallingConvention.Winapi)]
InBlock.gif
//说明:    核对卡密码  
InBlock.gif
//调用:    icdev:    通讯设备标识符  len:      密码个数,其值为3 p_string: 密码字符串指针
InBlock.gif
//返回:     <0   错误    =0   密码正确
InBlock.gif
        public static extern int Csc_4442(int icdev, int len, [MarshalAs(UnmanagedType.LPArray)] byte[] p_string);
InBlock.gif
InBlock.gif
InBlock.gif[DllImport(
"Mwic_32.dll", EntryPoint="wsc_4442",  SetLastError=true,
InBlock.gif CharSet
=CharSet.Auto, ExactSpelling=true,
InBlock.gif CallingConvention
=CallingConvention.StdCall)]
InBlock.gif
//说明:    改写卡密码
InBlock.gif
//调用:    icdev:    通讯设备标识符 len: 密码个数,其值为3 p_string: 新密码地址指针
InBlock.gif
//返回:    <0   错误   =0   正确
InBlock.gif
public static extern int Wsc_4442(int icdev, int len, string p_string);
InBlock.gif
InBlock.gif[DllImport(
"Mwic_32.dll", EntryPoint="rsc_4442",  CharSet=CharSet.Auto,CallingConvention=CallingConvention.Winapi )]
InBlock.gif
//说明:    读出卡密码  
InBlock.gif
//调用:    icdev:    通讯设备标识符  len:      密码个数,其值为3 p_string: 存放密码地址指针
InBlock.gif    
// 返回:    <>0   错误   =0   正确
InBlock.gif
 public static extern int Rsc_4442(int icdev, int len,  [MarshalAs(UnmanagedType.LPArray)] byte[] p_string);
InBlock.gif
InBlock.gif[DllImport(
"Mwic_32.dll", EntryPoint="rsct_4442",  SetLastError=true,
InBlock.gif CharSet
=CharSet.Auto, ExactSpelling=true,
InBlock.gif CallingConvention
=CallingConvention.StdCall)]
InBlock.gif
//说明:    读出密码错误计数器值
InBlock.gif
//调用:    icdev:    通讯设备标识符 counter:  密码错误记数值存放指针
InBlock.gif
//返回:     <0   错误 >=0   正确
InBlock.gif
public static extern int Rsct_4442(int icdev, int counter);
InBlock.gif
InBlock.gif
ExpandedSubBlockEnd.gif}

ExpandedBlockEnd.gif}

None.gif

URL:URL:http://community.csdn.net/Expert/topic/4877/4877324.xml?temp=.3906519
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值