| Printable Version
Lock Your Computer
By Adam Karim
So, in my quest for the perfect way to lock my Windows 2000 Pro, Server, or
Advanced Server since none have the "Window Key" + "L" that was introduced
with XP. I've used such things as shortcuts and Windows Scripting host in
order to quickly lock it but I wanted something easily transferable. Well,
here ya go, easy code to lock your comp:
namespace LockUp
{
using System;
using System.Runtime.InteropServices;
[DllImport("user32.dll")]
public static extern void LockWorkStation();
class Lock
{
static void Main(String[] args)
{
LockWorkStation();
}
}
}
Simple stuff but very useful;)
|