예제 #1
0
        /// <summary>
        /// 删除文件
        /// </summary>
        /// <param name="fileID"></param>
        /// <returns></returns>
        public static bool DeleteFile(ushort fileID)
        {
            try
            {
                cardReader.OpenReader(out string msgInf);

                //默认进行身份验证
                Auth();

                //先选择根目录
                cpuCard.SelectMF();

                //选择创建的文件夹
                ApduMsg msg = cpuCard.SelectFileById(fileID);

                if (msg.Code == "6A-82")
                {
                    return(true);
                }
                else
                {
                    ApduMsg ms2g = cpuCard.RemoveDF();
                    Console.WriteLine();
                }



                //再退出到根目录
                cpuCard.SelectMF();
                if (msg.IsSuccess)
                {
                    return(true);
                }
                // cardReader.CloseReader();
            }
            catch (Exception ex)
            {
                return(false);
            }
            finally
            {
                // run.Close();
            }
            return(false);
        }
예제 #2
0
        private void button8_Click(object sender, EventArgs e)
        {
            ApduMsg msg = CardReader.RemoveDF();

            DisplayLog(msg);
        }