Process.Start()何时可以返回null? [英] When can Process.Start() return null?

查看:110
本文介绍了Process.Start()何时可以返回null?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些代码通过使用流程来启动流程。开始(ProcessStartInfo)。我从文档中看到,如果重用现有流程,则此方法可以返回null。

I have some code that starts a process by using Process.Start(ProcessStartInfo). I see from the documentation that this method can return null if an existing process is reused.


[返回一个与之关联的新Process组件包含流程
资源,如果没有启动任何流程资源,则返回null(例如,
如果现有流程被重用)。

要重用现有流程是什么意思,在什么情况下会发生这种情况?

What does it mean for an existing process to be reused and under what circumstances will this happen?

推荐答案

如果您调用传递文件(而不是EXE)并将文件配置为使用DDE启动,则会发生这种情况。

This would happen if you call pass a file (not an EXE), and the file is configured to launch using DDE.

例如,这就是Office应用程序在现有实例中打开文件的方式。

For example, this is how Office applications open files in existing instances.

这篇关于Process.Start()何时可以返回null?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆