Previous..
Next...
Here i will explain How to launch any (_exe) file in any directory in window application.
Step(1): Form
Drag and down a button from ToolBox.
Step(2): Code
Double click on button and write this code.
Add a NameSpace " Using System.Diagnostics;"
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
Using System.Diagnostics;
using System.Text;
using System.IO;
using System.IO;
namespace First_Csharp_app
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Choose_Btn_click(object sender, EventArgs e)
{
OpenFileDialog openfile = new OpenFileDialog ();
if(openfile .ShowDialog() ==System.Window.Forms.DialogResult.OK)
{
{
OpenFileDialog openfile = new OpenFileDialog ();
if(openfile .ShowDialog() ==System.Window.Forms.DialogResult.OK)
{
String FilePath = openfile .FileName;
Process.Start( FilePath );
}
}
}
Run Your application
Previous..
Next...
No comments:
Post a Comment