In my previous article I have shown you Upload, Read and Display Excel File in .Net Core Using C#.net Windows Application, How to Show Error & Warning MessageBox in C#.Net, Windows Application, Encrypt and Decrypt Strings in C#.Net & VB.NET With a Secret Key, Remove Password/ Decrypt Excel Using C#, VB.Net in Windows Application.
So, for this article first we will create a new windows application and add a windows form. In this form add a button control. On click on this button we will open the command prompt.
C#.Net
private void button1_Click(object sender, EventArgs e)
{
string strCmdText;
strCmdText = "command prompt";
System.Diagnostics.Process.Start("CMD.exe", strCmdText);
}
VB. Net
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim strCmdText As String
strCmdText = "command prompt"
System.Diagnostics.Process.Start("CMD.exe", strCmdText)
End Sub In above code I have used Process.Start to open the command prompt. Now let's run the code to check the output.


