Sunday, August 30, 2009

Posting Code in Blogger

This posting is off topic too, but I have finally found some good instructions on posting code samples on Blogger. See this post for details:

http://abhisanoujam.blogspot.com/2008/12/blogger-syntax-highlighting.html

Thursday, August 27, 2009

Restarting IIS from the Command-Line

This posting is a little off topic, but I always forget the command-line command to restart IIS. It is simply: iisreset


Here is more info at:

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/003ed2fe-6339-4919-b577-6aa965994a9b.mspx?mfr=true

Tuesday, August 4, 2009

How to tell in VB.NET or C# if the Ctrl or Shift Key are being pressed

Sometimes you may need to know if the Ctrl or Shift key is being pressed by checking its state instead of using a key event. Also, most solutions to this problem involve some pinvoking and the win32api GetKeyState, but it turns out to be very simple as this posting describes:

http://predicatet.blogspot.com/2008/04/how-to-detect-if-shift-or-control-key.html


Here is the gist:

if (Control.ModifierKeys == Keys.Control)
{

}