写一个程序可以自动捕捉电脑桌面并且保存为图片
然后发送给另一台电脑

解决方案 »

  1.   

    http://www.cnblogs.com/dingshouqing/archive/2011/10/19/2217194.html
    使用截图,然后发送图片
      

  2.   

    已实验通过。欢迎大家拍砖
     
    class Program
        {
            [System.Runtime.InteropServices.DllImport("gdi32.dll")]
            public static extern bool BitBlt(
                IntPtr hdcDest,
                int nXDest,
                int nYDest,
                int nWidth,
                int nHeight,
                IntPtr hdcsrc,
                int nXSrc,
                int nYSrc,
                System.Int32 dwRop);        public static Bitmap WindowFullScreen()
            {
                Graphics grpScreen = Graphics.FromHwnd(IntPtr.Zero);
                Bitmap bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width,
                    Screen.PrimaryScreen.Bounds.Height, grpScreen);
                Graphics grpBitmap = Graphics.FromImage(bitmap);
                IntPtr hdcScreen = grpScreen.GetHdc();
                IntPtr hdcBitmap = grpBitmap.GetHdc();
                BitBlt(hdcBitmap, 0, 0, bitmap.Width, bitmap.Height, hdcScreen, 0, 0, 0x00cc0020);
                grpBitmap.ReleaseHdc(hdcBitmap);
                grpScreen.ReleaseHdc(hdcScreen);
                grpBitmap.Dispose();
                grpScreen.Dispose();
                return bitmap;
            }        static void Main(string[] args)
            {
                Image image= WindowFullScreen() ;
                image.Save(@"\\v-lihjia1\Temp\New folder\1.jpg");//为远程电脑路径,需有写权限
                Console.ReadKey();
            }
        }