Re: how can i do a ocr programm by c#
The generic Bitmap object (System.Drawing) supports the GetPixel method. By combining this with some character recognition, I see no reason why an OCR application could not be developed.
I believe that OCR is usually based on fuzzy-logic and is implemented by instead of "if a=b" but instead "if a>=b and a<=c" - with b and c being determined by stats.
OCR logic is quite difficult. The easiest implementation I have seen is to create a bitmap of every character in a font and then use the equivalent of google searching to map the character to the one in your map. It is not straightforward in any language - like coding an index for a database - more maths than code.
I cannot supply code (too much to think, TBH), but I hope my pointers have helped.
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)