How to put your PC in sleep or hibernate via C#
I thought that is impossible to put your PC in sleep or hibernate via C#. I found that is incorrect! Moreover, that is very simple too, just one line of command.
Putting the PC in sleep mode
Code
Application.SetSuspendState(PowerState.Suspend, false, false); |
Putting the PC in Hibernate mode
Code
Application.SetSuspendState(PowerState.Hibernate, false, false); |
That is so simple!!!
Virtuemart supports Joomla 1.7
Virtuemart is my choice for shopping cart. It can integrate with Joomla. But that only supported Joomla 1.5 before, even version 1.7 is the market for a few months. Yesterday, I saw there is Virtuemart 2.0, which supports Joomla 1.7. That is great!
Please click here to download Virtuemart.
Wikipedia will back down soon
Wikipedia will back down soon. They will shutdown on 05.00 UTC , today(18/1/2012), for 24 hours. That is protesting Protect IP Act in US.Please find the further details in here.
Windows Service Tutorial 1
This tutorial is to build a simple Windows Services.
1. Create a Windows Service Project, File->New->Project
2. Please add these codes into Services1.cs
Code
protected override void OnStart(string[] args) | |
{ | |
EventLog.WriteEntry("Example Start"); | |
System.Timers.Timer timer1 = new System.Timers.Timer(); | |
timer1.Enabled = true; | |
timer1.Interval = 60000; | |
timer1.Elapsed += new System.Timers.ElapsedEventHandler(timer1_Elapsed); | |
timer1.Start(); | |
} | |
| |
void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e) | |
{ | |
EventLog.WriteEntry("Timer Triggered:"+DateTime.Now.ToString()); | |
} | |
| |
protected override void OnStop() | |
{ | |
EventLog.WriteEntry("Example Stop"); | |
} |
A Hoax about Whatsapp New Services Charge
I got a same WhatsApp message from a number of friends. The message is about WhatsApp will charge for their service unless you are a frequent user. And it asks you to forward that message to 10 people. I checked the official blog of WhatsApp. That is not truth, the message is a hoax. If you get that message, please do not forward that!!!
Reference
Official blog of WhatsApp