如何在Windows应用程序中集成命令提示符 [英] How to integrate command Prompt in Windows From Application

查看:79
本文介绍了如何在Windows应用程序中集成命令提示符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我目前正在使用Windows From应用程序,当点击按钮时,它将在命令提示符下运行一些命令。

我成功编写代码当单击一个按钮并逐个运行多个命令时,将打开命令提示符。

现在我想在Windows窗体中集成此命令提示符,而不是外部命令提示符窗口。 br />


  if (txtPath.Text.ToString()!=  
{
string cmd1 = string .Format( @ / k pushd + txtPath.Text.ToString());
string cmd2 = string .Format( batch1.exe);
ProcessStartInfo cmdsi = new ProcessStartInfo( cmd .EXE);
cmdsi.Arguments = cmd1 + & + cmd2;
Process.Start(cmdsi);
}





请帮我解释如何实现此功能...

解决方案

希望本文能够指导您嵌入控制台一个C#应用程序 [ ^ ]

Hello,
I am currently working with a Windows From application that will run some commands in command prompt when buttons are clicked.
I am successful to write a code that will open the command prompt when a button is clicked and run multiple commands one-by-one.
Now i want to integrate this command prompt in my windows form instead of an external command prompt window.

if (txtPath.Text.ToString() != "")
{
        string cmd1 = string.Format(@"/k pushd " + txtPath.Text.ToString());
        string cmd2 = string.Format("batch1.exe");
        ProcessStartInfo cmdsi = new ProcessStartInfo("cmd.exe");
        cmdsi.Arguments = cmd1 + "&" + cmd2;
        Process.Start(cmdsi);
}



Please help me how i can implement this feature...

解决方案

Hope that this article will guide you Embedding a Console in a C# Application[^]


这篇关于如何在Windows应用程序中集成命令提示符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆