保存文件而不显示对话框
我想保存许多文件,几乎 200 个。当我只保存几个文件时,我会这样做:
dialog.Filter = "Bmp files (*.bmp)|*.bmp";
dialog.FileName = name + "_copy";
dialog.ShowDialog();
bitmap1.Save(dialog.FileName);
我怎样才能做同样的事情但不使用dialog.showdialog()?
I want to save many files, almost 200. When i'm saving only a few i'm doing it this way:
dialog.Filter = "Bmp files (*.bmp)|*.bmp";
dialog.FileName = name + "_copy";
dialog.ShowDialog();
bitmap1.Save(dialog.FileName);
How can i do the same but without using dialog.showdialog() ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看你的代码。 Save 方法接受一个字符串参数,即文件路径。显然,您不需要用户输入该路径,您只需提供自己的路径即可。
您没有提供太多信息,所以也许您的问题是知道实际保存文件的位置?如果您不需要用户输入(即,您不想使用文件对话框),那么您将需要确定一些组织这些文件的方案。
Look at your code. The Save method takes a string argument, i.e., the file path. You obviously don't need the user to enter that, you can simply provide your own path.
You haven't provided much info, so perhaps your problem is knowing where to actually save the files? If you don't need user input (i.e., you don't want to use a FileDialog), then you will need to determine some scheme for organizing these files.