What’s the difference between Process and ProcessStartInfo in C#?

前端 未结 2 868
轻奢々
轻奢々 2021-01-02 00:33

What’s the difference between Process and ProcessStartInfo? I’ve used both to launch external programs but there has to be a reason there are two w

2条回答
  •  别那么骄傲
    2021-01-02 00:57

    They are pretty close to the same, both are from the Process class. And there are actually 4 other overloads to Process.Start other than what you mentioned, all static.

    One is a static method way to do it. It returns the Process object representing the process that is started. You could for example start a process with a single line of code by using this way.

    And the other is a member method way to do it which reuses the current object instead of returning a new one.

提交回复
热议问题