資源簡介
主要是通過輪詢服務獲取服務端考勤隊列消息的項目實例,如需配置請聯系作者qq:1213707740
代碼片段和文件信息
//?***********************************************************************
//?Assembly?????????:?RTSafe.LepusTimidus.ReadFileService
//?Author???????????:?李端輝
//?Created??????????:?2019-10-18
//
//?Last?Modified?By?:?李端輝
//?Last?Modified?On?:?2019-10-18
//?***********************************************************************
//?
//?????Copyright?(c)?上海同是科技股份有限公司.?All?rights?reserved.
//?
//?盾構定時服務
//?***********************************************************************
using?System;
using?System.Collections;
using?System.Collections.Generic;
using?System.Configuration;
using?System.IO;
using?System.Linq;
using?System.Net;
using?System.Text;
using?System.Threading.Tasks;
namespace?ReadFileService
{
????public?class?FileService
????{
????????public?FileService()
????????{
????????}
????????public?void?onstart(string[]?args)
????????{
????????????ConfigurationManager.RefreshSection(“appSettings“);//?刷新命名節,在下次檢索它時將從磁盤重新讀取它。
????????????var?time?=?Math.Abs(int.Parse(ConfigurationManager.AppSettings[“time“]));
????????????System.Timers.Timer?t?=?new?System.Timers.Timer();
????????????t.Interval?=?time;
????????????t.Elapsed?+=?new?System.Timers.ElapsedEventHandler(ChkSrv);//到達時間的時候執行事件;?
????????????t.AutoReset?=?true;//設置是執行一次(false)還是一直執行(true);?
????????????t.Enabled?=?true;//是否執行System.Timers.Timer.Elapsed事件;?
????????}
????????public?void?onstop()
????????{
????????????writestr(“服務停止“);
????????}
????????public?void?ChkSrv(object?source?System.Timers.ElapsedEventArgs?e)
????????{
????????????writestr(“開始執行“);
????????????int?intHour?=?e.SignalTime.Hour;
????????????int?intMinute?=?e.SignalTime.Minute;
????????????int?intSecond?=?e.SignalTime.Second;
????????????///定時設置判斷分時秒
????????????try
????????????{
????????????????System.Timers.Timer?tt?=?(System.Timers.Timer)source;
????????????????tt.Enabled?=?false;
????????????????SetInnPoint();
????????????????tt.Enabled?=?true;
????????????}
????????????catch?(Exception?err)
????????????{
????????????????writestr(err.Message);
????????????????writestr(err.StackTrace);
????????????}
????????}
????????public?void?SetInnPoint()
????????{
????????????try
????????????{
????????????????writestr(“服務運行“);
????????????????//這里執行你的東西
????????????????ConfigurationManager.RefreshSection(“appSettings“);//?刷新命名節,在下次檢索它時將從磁盤重新讀取它。
????????????????
????????????????
????????????}
????????????catch?(Exception?err)
????????????{
???????????????
????????????}
????????}
????????public?void?writestr(string?readme)
????????{
????????????Console.WriteLine(string.Format(“{0}:{1}“DateTime.Now.ToString(“yyyy-MM-dd?HH:mm:ss“)?readme));
????????}
???????
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????692??2021-01-14?10:50??ReadFileService\App.config
?????文件??????24504??2021-01-13?15:27??ReadFileService\bin\Debug\app.publish\ReadFileService.exe
?????文件?????????44??2020-12-30?09:49??ReadFileService\bin\Debug\data.json
?????文件?????216064??2020-08-03?16:40??ReadFileService\bin\Debug\GetuiServerApiSDK.dll
?????文件?????319488??2020-08-03?16:40??ReadFileService\bin\Debug\Google.ProtocolBuffers.dll
?????文件???????7031??2021-01-05?15:26??ReadFileService\bin\Debug\log\error\202101\05.log
?????文件???????5754??2021-01-06?15:20??ReadFileService\bin\Debug\log\error\202101\06.log
?????文件??????????0??2021-01-07?15:34??ReadFileService\bin\Debug\log\error\202101\07.log
?????文件??????????0??2021-01-08?12:43??ReadFileService\bin\Debug\log\error\202101\08.log
?????文件????4923347??2021-01-05?23:59??ReadFileService\bin\Debug\log\info\202101\05.log
?????文件???13207776??2021-01-06?23:59??ReadFileService\bin\Debug\log\info\202101\06.log
?????文件??????????0??2021-01-07?15:48??ReadFileService\bin\Debug\log\info\202101\07.log
?????文件?????742983??2021-01-08?12:50??ReadFileService\bin\Debug\log\info\202101\08.log
?????文件???????2758??2020-12-30?09:49??ReadFileService\bin\Debug\log4net.config
?????文件?????276480??2020-08-03?16:40??ReadFileService\bin\Debug\log4net.dll
?????文件????1547797??2020-08-03?16:40??ReadFileService\bin\Debug\log4net.xm
?????文件?????170800??2015-12-01?14:31??ReadFileService\bin\Debug\Microsoft.Diagnostics.Tracing.EventSource.dll
?????文件?????203320??2015-12-01?14:31??ReadFileService\bin\Debug\Microsoft.Diagnostics.Tracing.EventSource.xm
?????文件??????45416??2020-08-03?16:40??ReadFileService\bin\Debug\Microsoft.Web.Infrastructure.dll
?????文件?????698792??2019-08-19?05:47??ReadFileService\bin\Debug\Newtonsoft.Json.dll
?????文件?????703462??2019-08-19?05:41??ReadFileService\bin\Debug\Newtonsoft.Json.xm
?????文件????????405??2021-01-05?14:12??ReadFileService\bin\Debug\packages.config
?????文件?????278528??2019-10-11?17:17??ReadFileService\bin\Debug\RabbitMQ.Client.dll
?????文件?????351876??2019-10-11?17:17??ReadFileService\bin\Debug\RabbitMQ.Client.xm
?????文件???????1862??2021-01-13?15:27??ReadFileService\bin\Debug\ReadFileService.application
?????文件??????23552??2021-01-13?15:26??ReadFileService\bin\Debug\ReadFileService.exe
?????文件???????1812??2021-01-13?15:26??ReadFileService\bin\Debug\ReadFileService.exe.config
?????文件??????14710??2021-01-13?15:27??ReadFileService\bin\Debug\ReadFileService.exe.manifest
?????文件???????3414??2021-01-05?15:04??ReadFileService\bin\Debug\ReadFileService.InstallLog
?????文件??????58880??2021-01-13?15:26??ReadFileService\bin\Debug\ReadFileService.pdb
............此處省略75個文件信息
評論
共有 條評論