protected void Btn_Execute_Click(object sender, EventArgs e)
{
try
{
Process myprocess = new Process();
myprocess.StartInfo.FileName = ExePath;
myprocess.StartInfo.FileName = @"D:\exefilename.exe";
myprocess.Start();
td_Mesg.Visible = true;
}
catch(Exception ex)
{
Response.Write(ex.Message.ToString());
}
finally
{
;
}
}
protected void Btn_Stop_Click(object sender, EventArgs e)
{
try
{
Process[] p = Process.GetProcessesByName("processname");
for (int i = 0; i < p.Length; i++)
{
p[i].Kill();
}
if (p.Length > 0)
{
td_Mesg.InnerHtml = "EXE stopped successfully ...";
}
else
{
td_Mesg.InnerHtml = "Currently EXE is not running ...";
}
}
catch (Exception ex)
{
td_Mesg.InnerHtml = ex.Message.ToString();
}
finally
{
;
}
}
{
try
{
Process myprocess = new Process();
myprocess.StartInfo.FileName = ExePath;
myprocess.StartInfo.FileName = @"D:\exefilename.exe";
myprocess.Start();
td_Mesg.Visible = true;
}
catch(Exception ex)
{
Response.Write(ex.Message.ToString());
}
finally
{
;
}
}
protected void Btn_Stop_Click(object sender, EventArgs e)
{
try
{
Process[] p = Process.GetProcessesByName("processname");
for (int i = 0; i < p.Length; i++)
{
p[i].Kill();
}
if (p.Length > 0)
{
td_Mesg.InnerHtml = "EXE stopped successfully ...";
}
else
{
td_Mesg.InnerHtml = "Currently EXE is not running ...";
}
}
catch (Exception ex)
{
td_Mesg.InnerHtml = ex.Message.ToString();
}
finally
{
;
}
}
No comments:
Post a Comment