This project is read-only.

The process cannot access the file because it is being used by another process.

Jun 4, 2013 at 1:57 AM
                using (CDReader read = new CDReader(new FileStream((Path.Combine(Environment.CurrentDirectory, @"Memstick\ISO", listBox1.GetItemText(listBox1.SelectedItem) + ".iso")), FileMode.Open), false))
                {
                    if (read.FileExists(@"PSP_GAME\PARAM.SFO"))
                    {
                        Stream sfo = read.OpenFile(@"PSP_GAME\PARAM.SFO", FileMode.Open);

                        using (SFO parser = new SFO(sfo))
                        {

                            if (parser.CheckMagic())
                            {
                            }

                        }
                        sfo.Dispose();
                    }

                    if (read.FileExists(@"PSP_GAME\PIC0.PNG"))
                    {
                        using (Image pic0 = Image.FromStream(read.OpenFile(@"PSP_GAME\PIC0.PNG", FileMode.Open)))
                        {
                            pictureBox1.CreateGraphics().DrawImageUnscaled(pic0, 60, 10);
                        }
                    }
                    else
                    {
                        pictureBox1.CreateGraphics().Clear(Color.White);
                    }

                    if (read.FileExists(@"PSP_GAME\ICON0.PNG"))
                    {
                        using (Image icon0 = Image.FromStream(read.OpenFile(@"PSP_GAME\ICON0.PNG", FileMode.Open)))
                        {
                            pictureBox1.CreateGraphics().DrawImage(icon0, 0, 153, (int)(icon0.Width * 1.5), (int)(icon0.Height * 1.5));
                        }
                    }
                }
I am using the code shown above to access an ISO file, as you can see, I have put everything in using statements so everything should be getting disposed, but that is not happening, I still get an error every time I access the file again, I have checked to make sure that it isn't another process acting up.

The process cannot access the file '******.iso' because it is being used by another process.