Windows Programming Part 11.4: OpenFileDialog and SaveFileDialog


More tutorials can be found at

This post is a portion of my series on Windows Programming using C# (C Sharp). You can see all of the posts by going to and clicking the “Windows Programming with C#” button at the top of the site.



  1. Hi sir, what if I want to open and save an image, should I use streamwriter too? If not, what should I use? Thanks for this video btw. Good day!

  2. Hello sir I did exactly what you told in video to create OpenFileDialog but in this I am getting an error which I unable to solve as I am new to this language. The error is " Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process." Please sir help me out from this dilemma….. Navaneet


Please enter your comment!
Please enter your name here