このコードを使用して小さなプログラムを開始できます。
if (File.Exists(content[1]))
{
Process process = new Process();
try
{
process.StartInfo.UseShellExecute = false;
process.StartInfo.FileName = content[1];
process.StartInfo.CreateNoWindow = true;
process.Start();
SuccessMessage("Successfully launched " + content[0]);
//System.Diagnostics.Process.Start(content[1]);
}
catch (Exception e)
{
ErrorMessage("Couldn't start the process!");
ErrorMessage(e.Message);
}
}
content[1]
ファイルへのパスが含まれます。
たとえば VLC を起動できますが、このコードで Visual Studio を起動できません。なんで?