Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.CheckFileExists = true;
            ofd.Filter          = Resources.MFD文件_mfd_dump;
            ofd.Title           = Resources.请选择需要打开的MFD文件_比较B;
            ofd.Multiselect     = false;
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                fb = ofd.FileName;
            }
            else
            {
                return;
            }
            sb = new S50();
            try
            {
                sb.LoadFromMfd(fb);
                button2.Text = "B=" + ofd.SafeFileName;
            }
            catch (IOException ioe)
            {
                MessageBox.Show(ioe.Message, Resources.打开出错, MessageBoxButtons.OK, MessageBoxIcon.Error);
                sb = new S50();
                return;
            }
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.CheckFileExists = true;
            ofd.Filter          = "MFD文件|*.mfd;*.dump";
            ofd.Title           = "请选择需要打开的MFD文件(比较A)";
            ofd.Multiselect     = false;
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                fa = ofd.FileName;
            }
            else
            {
                return;
            }
            sa = new S50();
            try
            {
                sa.LoadFromMfd(fa);
                button1.Text = "A=" + ofd.SafeFileName;
            }
            catch (IOException ioe)
            {
                MessageBox.Show(ioe.Message, "打开出错", MessageBoxButtons.OK, MessageBoxIcon.Error);
                sa = new S50();
                return;
            }
        }
Ejemplo n.º 3
0
        bool writecheck(string file)
        {
            S50 card = new S50();

            try
            {
                card.LoadFromMfd(file);
            }
            catch (IOException ioe)
            {
                MessageBox.Show(ioe.Message, "打开出错", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
            if (card.Verify()[16] == 0x00)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }