我想将图像保存到其他文件夹,但它会抛出此异常new_word
这是我的代码:
system.runtime.interopservices.externalexception (0x80040005)
当我在visual studio中运行它时,此程序有效,但是当我使用InstallShield创建安装文件时,它会抛出异常。
答案 0 :(得分:1)
我有同样的问题,经过长时间的搜索后,我更改了文件夹,我的程序正常运行。我想如果你使用这段代码,程序就会运行。
首先,我在C
驱动器
if (!Directory.Exists((@"C:\Image")))
Directory.CreateDirectory((@"C:\Image"));
然后我将图片保存到其中。
new Bitmap(pictureBox1.Image).Save(@"C:\Image" + @"\" +/* your file name */+ ".jpg");
我希望它适合你;)