Sunday, November 17, 2013

C# System wide shortcut keys | Global Hot-key in C#

  1. using System;
  2. using System.Runtime.InteropServices;
  3. using System.Windows.Forms;
  4. namespace WindowsFormsApplication1
  5. {
  6.         public partial class Form1 : Form
  7.         {
  8.                 private static int _hookHandle = 0;
  9.                 [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
  10.                 public static extern int SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hInstance, intthreadId);
  11.                 [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
  12.                 public static extern bool UnhookWindowsHookEx(int idHook);
  13.                 [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
  14.                 public static extern int CallNextHookEx(int idHook, int nCode, IntPtr wParam, IntPtr lParam);
  15.                 [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
  16.                 public static extern short GetKeyState(int nVirtKey);
  17.                 public delegate int HookProc(int nCode, IntPtr wParam, IntPtr lParam);
  18.                 public const int WH_KEYBOARD_LL = 13; 
  19.                 public const int VK_LCONTROL = 0xA2;
  20.                 public const int VK_RCONTROL = 0xA3;
  21.                 public Form1()
  22.                 {
  23.                         InitializeComponent();
  24.                         SetHook();
  25.                 }

Tuesday, November 12, 2013

Port Check Tool In C#

Simple port check tool for windows









Tool Download here...


Link Type Size
7z
  12KB 
exe
 75KB

C# Source download

  1. using System;
  2. using System.Windows.Forms;
  3. using System.Net.Sockets;
  4. namespace PortCheck
  5. {
  6.     public partial class Form1 : Form
  7.     {
  8.         public Form1()
  9.         {
  10.             InitializeComponent();
  11.         }
  12.         private void btnCheck_Click(object sender, EventArgs e)
  13.         {
  14.             TcpClient cli = new TcpClient();
  15.             int port = 0;
  16.             string ip;
  17.             try
  18.             {
  19.                 port = Convert.ToInt32(txtPort.Text.Trim());
  20.                 ip = txtIP.Text.Length > 7 ? txtIP.Text : "0.0.0.0";
  21.                 cli.Connect(ip, port);
  22.                 MessageBox.Show(cli.Connected == true ? "Port Opened" : "Port Closed"this.Text);
  23.             }
  24.             catch (Exception ex) { MessageBox.Show(ex.Messagethis.Text); }
  25.         }
  26.     }
  27. }




Monday, November 11, 2013

Limitations of SQL Server 2008 R2 Express

1. Maximum 10 GB per database.
2. Uses no more than 1 processor.
3. Uses no more than 1 GB of internal memory.
4. NO Maintenance plans
5. NO Database mail
6. NO User instances
7. SQL Server Agent
8. NO Full-text search

Google Start Rewards Program

Program Rules

On October 9, 2013, we announced a new, experimental program that rewards proactive security improvements to select open-source projects. This effort complements and extends our long-running vulnerability reward programs for Google web applications and for Google Chrome.

Reward amounts

Rewards for qualifying submissions will range from $500 to $3,133.7. The final amount is always chosen at the discretion of the reward panel and is based on our judgment of the complexity and impact of the patch.