using C# Process to run a Executable program

后端 未结 1 924
没有蜡笔的小新
没有蜡笔的小新 2021-01-07 02:10

I am a Bioinformatic person and I use C# for my work. I have been using Processes in C# to run Executable programs several times. This time I have a new issue. I have downlo

相关标签:
1条回答
  • 2021-01-07 02:32

    One problem I can see is in the line where you set the Arguments:

    proc.StartInfo.Arguments = "blastp -query input.txt -db pdbaa -out output.txt";
    

    I think you meant:

    proc.StartInfo.Arguments = "-query input.txt -db pdbaa -out output.txt";
    

    So you don't need to specify the executable name again in the Arguments - that's what FileName is for.

    The other thing is that there are a lot of applications which don't behave too well if you don't use shell-execute to start them. Try it first with shell-execute (and obviously without redirecting any std*), and if it works that way, then you'll know what the issue is - although I'm afraid there's not much you can do about it.

    Also, why is the line

    proc.StartInfo.RedirectStandardError = true;
    

    repeated twice?

    0 讨论(0)
提交回复
热议问题