if the file format is .JPG, there is no problem of opening a .jpg file.
however, if it is .png file, it gives the exception, how do we overcome this?
error as below:
System.ComponentModel.Win32Exception was unhandled
Message=No application is associated with the specified file for this operation
Source=System
ErrorCode=-2147467259
NativeErrorCode=1155
StackTrace:
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
thanks
Process.Start cannot open .PNG file
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Jan 2, 2013, 11:56 PM EST
This can be done from Control Panel.
For example, in Windows 7 go to:
Programs -> Default Programs -> Make a file type always open in a specific program
then scroll down to and select the .png extension, click on Change and select a default application such as Windows Photo Viewer.
Alternatively, if you don't want to make a permanent setting, then use the Process class to run the .exe you want to use and pass it the path to the .png file as an argument.
TAN WhoAMIRank #5,790 · 286 reputationPosted Jan 3, 2013, 1:28 PM EST
Why is it that the Default program with Windows Photo Viewer will work, while Default program using Paint will not work?