שתף באמצעות


how to sleep and awake a computer

Question

Thursday, December 4, 2014 7:30 AM

Greetings!,

is it possible to put a computer sleep and awake when i press a button? i will use this for my thesis...tnx

All replies (11)

Thursday, December 4, 2014 9:27 AM ✅Answered

Hi

Yes it is possible, you can do it using C# code.

To sleep

Application.SetSuspendState(PowerState.Suspend, false, false);

To wake up

http://www.anotherchris.net/csharp/wake-up-from-sleep-createwaitabletimer-in-csharp/

Thanks & Regards
Syed Amjad Sr. Silverlight/WPF Developer,
yahoo : syedamjad6736@yahoo.com, skype : syedamjad.0786.
Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.


Thursday, December 4, 2014 11:10 AM ✅Answered | 1 vote

Hi

Yes it is possible, you can do it using C# code.

To sleep

Application.SetSuspendState(PowerState.Suspend, false, false);

To wake up

http://www.anotherchris.net/csharp/wake-up-from-sleep-createwaitabletimer-in-csharp/

Thanks & Regards
Syed Amjad Sr. Silverlight/WPF Developer,
yahoo : syedamjad6736@yahoo.com, skype : syedamjad.0786.
Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

What is wrong here .. VB Forum here

You can do it using VB code 


Thursday, December 4, 2014 11:52 AM ✅Answered

Hi,

 As has been said, you can use the Application.SetSuspendState Method to put the system into sleep mode. You can check out the link and read what the 3 parameters are used for.

 However, i don`t understand how you plan on waking the system by pressing a button. You will have to wake the system before you would be able to press the button on your app. Perhaps you mean you want to press the button to put the system to sleep for a certain amount of time and then have it automatically wake the system ??   8)

If you say it can`t be done then i`ll try it


Thursday, December 4, 2014 12:25 PM

Greetings!,

is it possible to put a computer sleep and awake when i press a button? i will use this for my thesis...tnx

I hope this is like an elementary school thesis if all it has to do with is placing a computer in sleep mode by selecting a button.

However you can't wake a computer by selecting a button as no button, application or anything else is displayed while a computer is in sleep mode.

You can wake a computer at a preset time or time interval with your app once your app places a computer in sleep mode.

Here's how I wake my computer.

La vida loca


Thursday, December 4, 2014 12:38 PM

Here's how I wake my computer.

La vida loca

 And here is how you put it to sleep rite ?

If you say it can`t be done then i`ll try it


Friday, December 5, 2014 6:31 AM

Here's how I wake my computer.

La vida loca

 And here is how you put it to sleep rite ?

If you say it can`t be done then i`ll try it

You got it! ROTFLMAO!

La vida loca


Wednesday, December 10, 2014 1:13 AM

I'am developing an internet cafe system it is my thesis, if it is successful it will be used in our school... :)


Wednesday, December 10, 2014 1:13 AM

haha the picture is  funny...


Wednesday, December 10, 2014 1:15 AM

I'm serious sir....


Wednesday, December 10, 2014 6:50 PM

So are they - how can you expect to wake up the computer by pressing a button when there is only a black screen?


Sunday, January 18, 2015 10:56 PM

I I'am developing an internet cafe timer, and I will be using that code...