每5分钟拍摄一次屏幕截图 [英] take screen shot after each 5 minuts

查看:111
本文介绍了每5分钟拍摄一次屏幕截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!
我创建了一个应用程序,该应用程序在单击按钮后拍摄了我的桌面的屏幕截图.代码如下:

hi!
i have created an app that takes a screen shot of my desktop after clicking on the button.here is the code:

private void button1_Click(object sender, EventArgs e)
       {
           this.Hide();
           timer1.Start();
       }

       private void timer1_Tick(object sender, EventArgs e)
       {
           Bitmap b = new Bitmap(ScreenWidth, ScreenHeight);
           g = Graphics.FromImage(b);
           g.CopyFromScreen(Point.Empty, Point.Empty, Screen.PrimaryScreen.Bounds.Size);
           pictureBox1.Image = b;
           this.Show();
           button2.Enabled = true;
           timer1.Stop();
       }







我想要的是使其自动化.以便每5分钟自动拍摄一次桌面屏幕截图.
请告诉我该怎么做.
在此先感谢







what i want is to make it automatic. so that it automatically takes the desktop screen shot after every 5 minutes.
please tell me how to do it.
thanks in advance

推荐答案



使用具有TimeSpan 属性的DispatcherTimer类,可以选择将您的应用程序作为Windows服务运行.

DispatcherTimer:
http://msdn.microsoft.com/de-de/library/system. windows.threading.dispatchertimer.aspx [ ^ ]

创建Windows服务:
在C#中创建基本Windows服务 [ ^ ]

致以最诚挚的问候
Hi,

use the DispatcherTimer Class with TimeSpan property, optionally you could run your application as a windows service.

DispatcherTimer:
http://msdn.microsoft.com/de-de/library/system.windows.threading.dispatchertimer.aspx[^]

Create a windows service:
Creating a Basic Windows Service in C#[^]

With Best Regards


这篇关于每5分钟拍摄一次屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆