How To Make A Shutdown Manager In C#
All tutorials created in C# to be posted in here.
1 post
Page 1 of 1
hey guys hehaho;
this is a small tutorial by the way i think this could be very useful to you all . now like we are creating shut down managers in vb.net you just need to add three buttons and change the text property as below
.
now you need to add user32.dll to make the program work so just add this piece of code under the
now add the codes for click event for buttons as below
for shutdown
now everything is done , go ahead and test it :geek:
this is a small tutorial by the way i think this could be very useful to you all . now like we are creating shut down managers in vb.net you just need to add three buttons and change the text property as below
- [#]Button1 = Logoff
[#]Button2 = Restart
[#]Button3 = Shut Down

now you need to add user32.dll to make the program work so just add this piece of code under the
Code: Select all
code -InitializeComponent();
}
Code: Select all
:ugeek: [DllImport("user32.dll")]
public static extern int ExitWindowsEx(int uFlags, int dwReason);
now add the codes for click event for buttons as below
- [-]Button1 = Code: Select all[-]Button2 =
ExitWindowsEx(0, 0);
Code: Select all[-]Button3 =ExitWindowsEx(2, 0);
Code: Select allExitWindowsEx(1, 0);
for shutdown
Code: Select all
for restartSystem.Diagnostics.Process.Start("Shutdown", "-s -t 10");
Code: Select all
for log offSystem.Diagnostics.Process.Start("Shutdown","-r -t 10")
Code: Select all
8-) system.Diagnostics.Process.Start("Shutdown","-l -t 10")
now everything is done , go ahead and test it :geek:
Find my programs on Softpedia
1 post
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023