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
Loading
VulpesPosted Jan 3, 2013, 4:56 AM
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 WhoAMIPosted Jan 3, 2013, 6:28 PM
Why is it that the Default program with Windows Photo Viewer will work, while Default program using Paint will not work?