Keep in touch

you can keep in touch with my all blogs and sites by install this Toolbar...
http://rworldtoolbar.ourtoolbar.com/

Friday, September 12, 2008

Code for Lock Computer, VS 2005, c#

Follwing code is for Lock a Computer. It is nothing but calling of
“ C:\WINDOWS\system32\rundll32.exe user32.dll,LockWorkStation” command. There
are Command for shut down, log off , restart....


using System;
using System.Collections.Generic;
using System.Text;
//using System.linq;
using System.Diagnostics;

namespace r.LockComputer
{
class Program
{
static void Main(string[] args)
{
Process.Start(@"C:\WINDOWS\system32\rundll32.exe", "user32.dll,LockWorkStation");
}
}
}

1 comment:

Anonymous said...

Thank you