C# Process.Start 参数被截断

标签 c# .net process truncate

在传递很长的文件路径时,我的参数被截断了。我需要启动一个程序并通过命令参数传递所有内容 - 有时它只是截断命令。它在全局范围内执行此操作 - 因此这不仅是每个参数的问题,而且是整个参数的问题。

编辑: 正如 monkey_p 所说,问题可能是命令行长度的限制。问题是:如何绕过它? (更改工作目录是行不通的,因为文件可能存在于不同的位置)。

最佳答案

我不确定您的问题是什么,但命令行有限制。同样的限制对于 Process.Start(command,args) 也有效

On computers running Microsoft Windows XP or later, the maximum length of the string that you can use at the command prompt is 8191 characters. On computers running Microsoft Windows 2000 or Windows NT 4.0, the maximum length of the string that you can use at the command prompt is 2047 characters.

关于C# Process.Start 参数被截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1200789/

相关文章:

c# - Visual Studio Community 2017 是否需要使用 Microsoft 帐户登录?

c# - 使用自定义 XML 部分隐藏 Word 内容控件

android - 如何在运行时获取应用程序的总内存使用量?

winapi - http请求的进程ID,安装程序

c# - 如何在 C# 中获取显式事件的调用列表

c# - 在 OOP 中表达类型组合

c# - System.StackOverflowException 未处理 - C#、.NET

.net - 使用 Postman 或 SoapUI 测试 WCF 服务会出现 400 Bad Request

c# - SharePoint 网络服务 : Need to fetch list in a sub-site

linux - 'per process' 是否也计入共享库/动态库?