I want to save in image to other folder but it throw this Exception system.runtime.interopservices.externalexception (0x80040005)
this is my code :
pictureBox1.Image.Save(@"" + Application.StartupPath + "\\Image" + "".ToString() + @"\" + @"personeli_" + textBox4.Text + ".jpg");
This program works when I run it in visual studio but when I create setup file with InstallShield it throw an Exception .
I have a same problem and after a long search, I change the folder and my program works .I think if you use this code , your program run .
first I create a directory in C
drive
if (!Directory.Exists((@"C:\Image")))
Directory.CreateDirectory((@"C:\Image"));
and after that I save picture into it .
new Bitmap(pictureBox1.Image).Save(@"C:\Image" + @"\" +/* your file name */+ ".jpg");
I hope it works for you ;)
User contributions licensed under CC BY-SA 3.0