using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace WindowsFormsApplication1
{
    public class MHCardReader
    {
        private int icdev;//验证标识
        [DllImport("mwhrf_bj.dll")]
        static extern int Open_USB();

        [DllImport("mwhrf_bj.dll")]
        static extern int rf_beep(int icdev, int _Msec);

         //[DllImport("mwhrf_bj.dll")]
       //  static extern int rf_card(int icdev,unsigned char _Mode,ref long _Snr);


        /// <summary>
        /// 打开设备
        /// </summary>
        /// <returns></returns>
        public bool OpenDevice()
        {
            icdev=Open_USB();
            if (icdev > 0)
            {
                return true;
            }
            return false;
        }
        /// <summary>
        /// 发声
        /// </summary>
        /// <returns></returns>
        public int ForceVoice()
        {
            return rf_beep(icdev,10);
        }


    }
}
