gpt4 book ai didi

c# - 从调用进程获取命令行

转载 作者:行者123 更新时间:2023-11-30 18:21:32 30 4
gpt4 key购买 nike

我们使用能够使用脚本完成不同任务的软件。

在一个脚本中,我想启动一个小帮助工具来输入一些额外的数据。因此我需要知道调用软件的命令行参数如下图所示。

TaskManager - Command line parameters

是否有可能从调用过程中获取这些信息,或者至少通过查找“图像名称”来获取它们?

最佳答案

将 Wapac 评论中的链接与 Simon Mourier 在 this 中的回答结合起来问题解决了问题。

现在我有两个助手类:

  1. CommandLineUtilities
  2. ParentProcessUtilities

在我的程序中,我现在只需要调用:

Process process = Process.GetCurrentProcess();
Process parent = ParentProcessUtilities.GetParentProcess(process.Id);
String[] parameters = CommandLineUtilities.getCommandLinesParsed(parent);

关于c# - 从调用进程获取命令行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35309421/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com