user449921
user449921

Reputation: 251

saving files without 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() ?

Upvotes: 1

Views: 1978

Answers (1)

Ed Swangren
Ed Swangren

Reputation: 124642

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.

 bitmap1.Save(@"C:\foo.bmp");

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.

Upvotes: 7

Related Questions