Utility.cs
/// <summary>
/// Opens the provided file location if it exists.
/// </summary>
/// <param name="fileName">An application with which to start a process.</param>
/// <param name="arguments">Command-line arguments to pass to the application when the process starts.</param>
/// <returns>If true, the file location has been opened; otherwise, false.</returns>
Opens the provided file location if it exists.
Opens the provided file location if it exists .
public Process OpenFile(string fileName, string arguments = null)
        {
            Process process = null;
            try
            {
                ProcessStartInfo startInfo = new ProcessStartInfo(fileName, arguments);
                startInfo.UseShellExecute = true;
                 The Windows error dialog does not allow you to choose a program anymore.
                startInfo.ErrorDialog = false;
                 First try to start and have Windows it's way.
                process = Process.Start(startInfo);
            }
            catch (Exception ex)
            {
                this.HandleException(ex);
            }
            return process;
        }
public Process OpenFile ( string fileName , string arguments = null ) { Process process = null ; try { ProcessStartInfo startInfo = new ProcessStartInfo ( fileName , arguments ) ; startInfo . UseShellExecute = true ; startInfo . ErrorDialog = false ; process = Process . Start ( startInfo ) ; } catch ( Exception ex ) { this . HandleException ( ex ) ; } return process ; }
Opens the provided file location if it exists.
Opens the provided file location if it exists .
// // The Windows error dialog does not allow you to choose a program anymore. // // // First try to start and have Windows it's way. //
If true, the file location has been opened; otherwise, false.
If true the file location has been opened ; otherwise false .
fileName
string
An application with which to start a process.
An application with which to start a process .
arguments
string
Command-line arguments to pass to the application when the process starts.
Command - line arguments to pass to the application when the process starts .