更新时间:2023-02-17 21:07:48
这是一个堆栈溢出问题,可以回答您的问题:
http://***.com/questions/2593313/how-to- execute-console-application-from-windows-form [ ^ ]
基本上,您使用System.Diagnostics.Process.Start
方法来调用应用程序并传递所需的参数.
Here is a Stack Overflow question that has the answer to your question:
http://***.com/questions/2593313/how-to-execute-console-application-from-windows-form[^]
Basically, you use theSystem.Diagnostics.Process.Start
method to call your app and pass in the parameters you want.
这实际上取决于H3LTON可执行文件的功能.
It all really depends what your H3LTON executable does.
System.Diagnostic.Process
与输入流重定向一起运行.输入流将是 System.IO.StreamReader [ ^ ] TextBox的字符串内容.System.Diagnostic.Process
is run with input stream redirection. The input stream would then be a System.IO.StreamReader[^] that would be fed from the string content of your TextBox.
因此,无论选择哪种方法,都应该了解您要实现的目标以及每种解决方案的优缺点.将代码保存到具有不断变化的临时文件名的中间文件中的优点是,在清除临时存储空间之前,用户输入的所有程序都不会丢失.这可以被认为是一个功能:).
问候,
曼弗雷德(Manfred)
So which ever method you choose you should be aware of what exactly you are trying to achieve and the benefits and drawbacks of each solution. Saving the code into an intermediate file with a constantly changing temporary filename has the advantage that all the programs a user entered will not be lost until the temporary storage space is cleard. This could be considered a feature :).
Regards,
Manfred