C# Open File With Associated Application passing arguments

前端 未结 3 1056
囚心锁ツ
囚心锁ツ 2021-01-24 19:00


I am trying to launch the default application registered for an extension specifying an additional argument:

 ProcessStartInfo p = new ProcessStartInfo();
          


        
3条回答
  •  孤街浪徒
    2021-01-24 19:15

    I think an easier method is using the cmd command

     void LaunchAssociatedProgram(string filename) {
         Process.Start( @"cmd.exe", "/C start "+ filename );
     }
    

    EDIT:

    I don't know if it works with arguments, but it is what I was looking for to launch an associated program...

提交回复
热议问题