Asp.net 运行带有参数的外部程序时出现问题

Asp.net 运行带有参数的外部程序时出现问题,asp.net,path,process.start,Asp.net,Path,Process.start,我的项目还有最后一个问题,我只是看不清楚到底哪里出了问题 当我用这个运行代码时,一切都很完美: Dim p As Process = New Process() With p.StartInfo .WorkingDirectory = Environment.GetEnvironmentVariable("ProgramFiles") & "\rest_of_my_path\" .FileName = "ping" .Arg

我的项目还有最后一个问题,我只是看不清楚到底哪里出了问题

当我用这个运行代码时,一切都很完美:

    Dim p As Process = New Process()
    With p.StartInfo
        .WorkingDirectory = Environment.GetEnvironmentVariable("ProgramFiles") & "\rest_of_my_path\"
        .FileName = "ping"
        .Arguments = "192.168.0.24"
        .CreateNoWindow = True
        .UseShellExecute = False
        .RedirectStandardOutput = True
        .RedirectStandardError = True
    End With
    p.Start()
然而,当我运行这个程序时,它在运行时出错,并在p.start()上崩溃

我尝试添加空格、引号,只是随便说说而已,但每次调用的目标都会抛出异常。 我相信它在抱怨这条路

我几乎可以肯定这很简单,但就是不能把我的手指放在上面


非常感谢您的帮助。

好的,找到了解决方案…如果有人感兴趣

而不是

.FileName = "myextprogram.exe"
.Arguments = "-n Unnamed -f file.abc"
我现在有

.FileName = "cmd"
.Arguments = "myextprogram.exe -n Unnamed -f file.abc"

现在一切正常。

没人有主意吗?
.FileName = "cmd"
.Arguments = "myextprogram.exe -n Unnamed -f file.abc"