none
Correct way to launch a file editor from WinForms app RRS feed

  • Question

  • I am trying to offer users the ability to edit image files from a WinForms application.  The files are sourced on a network drive.  I want to launch MSPaint to allow editing and then the Save needs to save it back to the network drive location. Using System.Diagnostic.Process to launch results in a sharing violation condition because the System.Diagnostics.Process has a lock on the file.  I have to close the WinForms application to remove the lock which is a useless solution.  If the file is sourced from My Documents, the System.Diagnostics.Process will not create a lock.  So, is there a way to launch MSPaint to edit the file from a network location or is there a setting to create the process without locking the file?  Perhaps the ProcessStartInfo has a setting I am not aware of that launches a process as a standalone, decoupled process?

    Friday, October 31, 2014 10:44 PM

Answers

All replies