Showing posts with label Diagnostics. Show all posts
Showing posts with label Diagnostics. Show all posts

Restart PC or Laptop WinForm Diagnostics Button Click Using in Asp.Net C#

Restart PC or Laptop 

Click Button Restart Your Working  PC or Laptop in WinForm Diagnostics in Asp.Net C#.




                        Download Coding
              
                                         Download


                          C# CODING


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Diagnostics;

public partial class Restarts : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {

    ProcessStartInfo restart = new ProcessStartInfo("shutdown.exe", "-r");

        Process.Start(restart);

    }

}


First Add - New Webform - Select Button From 

ToolBox





Next - Add - Namespaces - using System.Diagnostics; & ShutDown.exe






Next - Run[F5] - Click Restart Button - Restart system



Shut Down PC or Laptop WinForm Diagnostics Button Click Using in Asp.Net C#

Shut Down PC or Laptop 

Click Button Shut Down Your Working  PC or Laptop in WinForm Diagnostics in Asp.Net C#.


                           
                        Download Coding
              
                                         Download


                          C# CODING


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Diagnostics;


public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }  
    protected void Button1_Click(object sender, EventArgs e)
    {
      
   ProcessStartInfo shutdown = new ProcessStartInfo("shutdown.exe", "-s");

        Process.Start(shutdown);

    }

}


First -  Add New Form - Select Button - From 

ToolBox 





Next - Add Namespaces - using System.Diagnostics; & shutdown.Exe





Next - Run[F5] - Click Button - Shutdown