Click here to Skip to main content
15,899,126 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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();
        }
Posted

1 solution

Got the solution :

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900