C# System.Diagnostics.Process.Start() 参数
有人知道计算机在哪里保存它可以通过此功能接受的参数吗?例如,我想知道可以向 Winword.exe (Microsoft Word) 发送什么内容。或者有什么程序可以在这里运行的在线列表吗?
Anyone know where a computer keeps what parameters it can accept through this function? For example, I'd like to know what I can send to Winword.exe (Microsoft Word). Or is there an online list of what programs work here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
没有标准方法来查询可执行文件中可用的命令行参数。这就是为什么您必须在线查找已发布的列表。例如Microsoft Word。
Process.Start(..)重载方法将各种数据传递到进程中,但由于进程如何使用此信息的专有性质而无法提取它。
如果您启动了进程,则 Process.StartInfo 可能会提供一些有关它如何启动的有用信息(但不反映可能性),并且如果您只是从内存中获取未启动的进程,则不会按预期工作。
尽管许多 Windows 进程习惯上允许 /?生成参数列表,许多系统使用 -help、/help 或 --help 等,即使这些的输出也可能不同,并且很难一致地解析以进行发现目的。
There's no standard means to query available command line parameters in executables. That's why you have to look online for published lists. For example Microsoft Word.
The Process.Start(..) overloaded methods pass various data into the process but cannot extract it because of the proprietary nature how a Process uses this info.
If you started the processes then Process.StartInfo may provide some useful information about how it was started (but does not reflect possibilities), and won't work as intended if you're just grabbing a process from memory that you didn't start.
Although it's customary for many Windows processes to allow /? to produce a list of parameters, and many systems use -help, /help or --help, etc, the output of even those may differ and be tough to consistently parse for discovery purposes.
以下是 winword.exe 可接受的参数列表参数列表。
Here is a list of accepted arguments for winword.exe Args list.
应用程序接受的命令行参数不会存储在硬盘驱动器上的任何位置,除非该产品附带特定文档。话虽这么说,谷歌将是你最好的朋友。您认为可以使用不同参数从命令行启动的任何应用程序都会在网上提供一些信息。
The command line arguments that an application accepts isn't stored anywhere on your hard drive, unless if there's specific documentation that came along with that product. That being said, google will be your best friend for this. Any app you think can be launched from the command line using different parameters, will have some info on the net.
您可以转到应用程序的帮助并在那里找到它,或者您可以询问好心的老先生。谷歌来帮助你。如果您正在寻找Windows Word的args列表,您可以在Microsoft的支持页面上搜索它。我相信不同版本可能会有一些变化。
you can either go to your application's help and find it there, or you can ask good old mr. Google to help you. if you are looking for Windows Word's args list, you can search for it on the support page of Microsoft. I believe there might be some changes from version to version.
Unix 有一个内置的文档系统:手册页。这只是基于 Unix 的操作系统的一个特性,显示了它是如何面向程序员的(这不是一件坏事)。另一个是包装和依赖系统的分析。
遗憾的是,Windows 不存在这样的标准。
Unix has a built-in documentation system for this: man pages. This is just one feature of Unix based OSs that shows how programmer-oriented it is (not a bad thing). Another would be the profileration of packaging and dependency systems.
Alas, no such standard exists for Windows.