the above link is very useful.I used CaptureScreen()
method from the above mentioned link and created image and passed that image to the following code which creates the screen shot
Bitmap bitmap = new Bitmap(CaptureScreen()
Graphics graphics = Graphics.FromImage(bitmap as System.Drawing.Image);
graphics.CopyFromScreen(0, 0, 0, 0, bitmap.Size);
It will create the image in the path mentioned.