[HELP]Getting a black screen(C#-GL.glReadPixels)

Hello everyone,
I have 2 codes (I found in here/internet) that suppost to copy the pixels from my screen (By the OpenGL lib) into a Bitmap class.
The problem is that both of them print a black screen.

The codes:

        static Bitmap GrabScreenshot()
            Bitmap bmp = new Bitmap(800, 600);
            System.Drawing.Imaging.BitmapData data = bmp.LockBits(new Rectangle(0, 0, 800, 600), System.Drawing.Imaging.ImageLockMode.WriteOnly,
            GL.glReadPixels(0, 0, 800, 600, GL.GL_BGR, GL.GL_UNSIGNED_BYTE, data.Scan0);
            return bmp;
         static Bitmap GrabScreenshot()
            Size s = new Size();
            s.Width = 800;
            s.Height = 600;
            Bitmap b = new Bitmap(s.Width, s.Height, PixelFormat.Format32bppArgb);
            BitmapData bd = b.LockBits(new Rectangle(0, 0, s.Width, s.Height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
            GL.glReadPixels(0, 0, s.Width, s.Height, GL.GL_BGRA_EXT, GL.GL_UNSIGNED_BYTE, bd.Scan0);
             return b 

My main idea is to capture a screen when you are in a 3D game (Like: Counter-Strike/Counter-Strike:Source),
and few people told me that the solution for it is using OpenGL,

Thanks in advanced,

The code is correct: this will capture the contents of an OpenGL context into a System.Drawing.Bitmap.

However, the context will have to be current on the thread you are calling GrabScreenshot() from. If the context is in another process, this code is not going to work.

I think it is related to this recent thread:

Does that help you?