无法在bat文件中获取文本框数据 [英] unable to get the Textbox data in bat file

查看:93
本文介绍了无法在bat文件中获取文本框数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下面的代码中无法检索文件中的TxtUsername.Text数据。我不知道如何检索行中的文本框数据

输出应该是这样的:

c:

cd \\ \\ b
cd程序文件

cd VMware

cd VMware OVF工具

启动ovftool.exe --powerOffSource vi :// izaz


但我得出的结果为:

c:

cd \

cd程序文件

cd VMware

cd VMware OVF工具

start ovftool.exe --powerOffSource vi://




这是我的代码:



in the below code am unable to retreive the TxtUsername.Text data in file. I dont know how to retrieve the textbox data in the line
the output should be like this:
c:
cd \
cd Program Files
cd VMware
cd VMware OVF Tool
start ovftool.exe --powerOffSource vi://izaz

But am getting the out put as:
c:
cd \
cd Program Files
cd VMware
cd VMware OVF Tool
start ovftool.exe --powerOffSource vi://


here is my code:

private void BtnCreate_Click(object sender, EventArgs e)
        {
          StreamWriter file = new StreamWriter("Export.bat");
          file.WriteLine("c: ");
          file.WriteLine("cd \\");
          file.Write("cd Program Files " + Environment.NewLine);
          file.Write("cd VMware" + Environment.NewLine);
          file.Write("cd VMware OVF Tool" + Environment.NewLine);
          file.WriteLine("start ovftool.exe --powerOffSource vi://",TxtUsername.Text);
          file.Close();
        }

推荐答案

得到解决方案:



Got the solution :

file.WriteLine("start ovftool.exe --powerOffSource vi://"+ TxtUsername.Text);


这篇关于无法在bat文件中获取文本框数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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