以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]openQQ服务端如何自动重启动  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=113870)

--  作者:ajie5211
--  发布时间:2018/1/24 13:48:00
--  [求助]openQQ服务端如何自动重启动

如题,长时间运行后,有时会变慢或出错,希望服务端能每天早上1点钟自动关闭并重启动一次,如何写代码比较好?

计划管理里面这样写,间隔2100000,好像会启动多次,请帮助改改,或是有啥更好的方法没?

static cqdsj As Date = Date.today.AddDays(-1)
If cqdsj <> Date.today AndAlso Date.Now.Hour = 1 Then
    cqdsj = Date.today
    Application.restart
End If


--  作者:有点甜
--  发布时间:2018/1/24 14:32:00
--  
Dim cqdsj As Date = getConfigValue("重启时间", Date.today.AddDays(-1))
If cqdsj <> Date.today AndAlso Date.Now.Hour = 1 Then
    cqdsj = Date.today
    SaveConfigValue("重启时间", cqdsj)
    Application.restart
End If
[此贴子已经被作者于2018/1/24 14:37:52编辑过]