Hello! I just started trying to code in C# and got to a point where I was able to create a Windows Form Application with buttons that switch pages, and buttons that open, as an example, a hello world batch file.
Basically what I want it to do is to open up cmd, do the console.writeline commands and then automatically hit ENTER. But I cant figure it out, not even with google
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CMDopen
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello User");
Console.WriteLine("to start the ping-test, press enter");
Console.ReadLine();
Console.Write("ping google.de -t");
}
}
}
namespace SendKey1
{
public class Send
{
public static void main(string[] args)
{
Send.send("{ENTER");
}
}
}