Esempio n. 1
0
        private async void extractISOToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string InFile  = "";
            string OutPath = "";

            using (OpenFileDialog fd = new OpenFileDialog())
            {
                fd.Title  = Resources.select_spm_iso;
                fd.Filter = Resources.isoselect_filter;
                DialogResult dr = fd.ShowDialog();

                if (dr == DialogResult.OK)
                {
                    byte[] ISOID = ByteOps.GetNumBytes(3, 0, fd.FileName);

                    if (Encoding.ASCII.GetString(ISOID) != Resources.spm_titlecode)
                    {
                        MessageBox.Show(Resources.not_spm_iso);
                        return;
                    }
                    else
                    {
                        InFile = fd.FileName;
                    }

                    using (FolderBrowserDialog fb = new FolderBrowserDialog())
                    {
                        fb.Description         = Resources.select_iso_extract_dir;
                        fb.ShowNewFolderButton = false;
                        DialogResult drsf = fb.ShowDialog();

                        if (drsf == DialogResult.OK)
                        {
                            OutPath = Path.Combine(fb.SelectedPath, Encoding.ASCII.GetString(ByteOps.GetNumBytes(6, 0, fd.FileName)));

                            if (!Directory.Exists(OutPath) || MessageBox.Show(Resources.folder_will_be_overwritten, Resources.folder_will_be_overwritten_title, MessageBoxButtons.YesNo) == DialogResult.Yes)
                            {
                                await ExtractISO(InFile, OutPath);
                            }
                        }
                    }
                }
            }
        }
Esempio n. 2
0
 public virtual byte[] GetBytes()
 {
     byte[] Parsed = ByteOps.FormattedByteStringToByteArray(this.Text);
     _Bytes = Parsed == null ? _Bytes : Parsed;
     return(_Bytes);
 }