屏幕抓取是否有任何C#库?

时间:2010-06-25 08:06:32

标签: c# parsing screen-scraping

有很多用于python,php的开源屏幕抓取库。但是我找不到任何.Net对应物。你能推荐任何用于屏幕抓取的库或只是html解析,这会让生活更轻松。

3 个答案:

答案 0 :(得分:9)

请查看Html Agility Pack

答案 1 :(得分:2)

方法实施:

public static void CaptureImage(Point SourcePoint, Point DestinationPoint, 
         Rectangle SelectionRectangle, string FilePath)
         {
         using (Bitmap bitmap = new Bitmap(SelectionRectangle.Width, 
             SelectionRectangle.Height))
             {
             using (Graphics g = Graphics.FromImage(bitmap))
                 {
                 g.CopyFromScreen(SourcePoint, DestinationPoint, 
                     SelectionRectangle.Size);
                 }
             bitmap.Save(FilePath, ImageFormat.Bmp);
             }
         }
     }

后续电话:

Point StartPoint = new Point(ClickPoint.X, ClickPoint.Y);
Rectangle bounds = new Rectangle(ClickPoint.X, ClickPoint.Y, 
    CurrentPoint.X - ClickPoint.X, CurrentPoint.Y - ClickPoint.Y);
ScreenShot.CaptureImage(StartPoint, Point.Empty, bounds, ScreenPath);

归功于原作者@ http://www.codeproject.com/KB/cs/TeboScreen.aspx

答案 2 :(得分:0)

使用IRobotSoft的IRobot。