用参数运行程序

时间:2013-12-30 01:20:55

标签: c# process arguments

如果没有C#,它是如何工作的:

  1. Win + R
  2. 输入:
  3. “C:\ Riot Games \ League of Legends \ RADS \ solutions \ lol_game_client_sln \ releases \ 0.0.1.4 \ deploy \ League of Legends.exe”“8394”“LoLLauncher.exe”“”“旁观者95.172.65.26: 8088 If4hH4 / 27YhyycyAsxthGMnjzXaIgu7F 1249300997 EUW1“

    正如您所看到的,该过程有一些参数。我试过这个:

    string path = @"C:\Riot Games\League of Legends\RADS\solutions\lol_game_client_sln\releases\0.0.1.4\deploy\League of Legends.exe";
    
    string arguments =  @"""8394"" ""LoLLauncher.exe"" """" ""spectator 95.172.65.26:8088 " + firstgameinformation.Trim() + @" EUW1""";
    
    Process.Start(path,arguments);
    

    但程序运行方式不同,只是崩溃了。给出的论点肯定有问题。我甚至尝试使用ProcessStartInfo。无法理解这一点。

    那么如何以与Win + R相同的方式调用该过程?

    //编辑:Firstgameinformation与If4hH4 / 27YhyycyAsxthGMnjzXaIgu7F 1249300997相同

1 个答案:

答案 0 :(得分:0)

您可能必须设置ProcessStartInfo.WorkingDirectory属性,以便从可以找到的位置启动新进程,例如LoLLauncher.exe文件。