如何查询表格 [英] how to query a table

查看:89
本文介绍了如何查询表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Windows服务中查询表60秒钟?我已经创建了服务.当我不熟悉此服务时可以帮助我吗?

how to query a table for 60 secs in windows service??I have created the service..can some one help me as I''m new to this??

推荐答案

引用此链接

http://www .codeguru.com/csharp/.net/cpp_managed/windowsservices/article.php/c6919/Using-Timers-in-a-Windows-Service.htm [ http://stackoverflow.com/questions/5495842/use-of-timer-in- Windows服务 [ ^ ]
Refer this link

http://www.codeguru.com/csharp/.net/cpp_managed/windowsservices/article.php/c6919/Using-Timers-in-a-Windows-Service.htm[^]

http://stackoverflow.com/questions/5495842/use-of-timer-in-windows-service[^]


使用Timer类和ElapsedEventHandler委托.
示例代码如下所示

Use Timer class and ElapsedEventHandler delegate.
The sample code looks like below

double timeout = 900000;
if (time != null && time.Length > 0)
    timeout  = Convert.ToInt64(time);
System.Timers.Timer timer =  new System.Timers.Timer();
timer.Interval = timeout;
timer.AutoReset = true;
timer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimeReached);
timer.Start();



请根据您的方便更改超时值.以秒为单位.



Please change the timeout value accoring to ur convenience.It is in second.


这篇关于如何查询表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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