SetupTime - 系统时间自动更新
SetupTime 是 hiswing 写的非常简单,但很有创意的系统时间自动更新软件。
系统时间错乱首先想到的是 CMOS 电池问题,或者你说,换块电池不就可以了?OK,你不需要 SetupTime
SetupTime 适合稍微有点懒,不愿意拆机器,不愿下楼买电池。比如 sein 家的清华同方 就属于此列。
软件基本原理是
在 FTP 服务器上放了一个 PHP 文件,该文件仅仅用来取服务器的系统时间,再用利用VB程序读取该文件并将得到的时间设置为本机的时间。
需要源代码的去作者主页,里面提到的 PHP 文件已经被放置到了小众的 FTP 里面,如果你没有自己的 FTP ,那么就让自己的电脑和 CPH 主机同步吧,顺便我咨询了 Paveo,这个文件对服务器不会造成任何影响,仅仅是一个读取时间的函数而已。
当然了,为了小小的防御一下抄袭问题,我没有内置这个文件地址,下载 SetupTime 后先运行 setup.exe 输入
http://www.appinn.com/servertime.php
勾选随系统启动,放那就好了。
你也可以自己上传 php 文件,一个效果。
下载(9KB): easy-share | 来自 Appinn | mediafire | 纳米盘
P.S. 新年第一篇,有空总结一下,大家都快乐 ![]()
Tag: 时间, 更新, 系统 7,090 views




EnsonKing reply on 一月 1st, 2008,6:37 下午:
应该说是一回事吧。
hiswing reply on 一月 1st, 2008,7:57 下午:
sein reply on 一月 2nd, 2008,9:25 上午:
李二嫂的猪 reply on 一月 2nd, 2008,10:52 上午:
orz
sfufoet reply on 一月 2nd, 2008,12:42 下午:
Paveo reply on 一月 2nd, 2008,12:57 下午:
而且也不用vb来改时间,用vbs或则js就OK了
//get HTTP Date: response from server, return approximate dateVal object
function getServerDate(serverHttpAddress, httpProxyAddress)
{
var xmlHttp = new ActiveXObject(”msxml2.xmlhttp”);
if(httpProxyAddress)
{
setProxy(2,proxyHttpAddress.replace(”http://”,”"));
}
xmlHttp.open(”GET”, serverHttpAddress, 0);
ts=(new Date()).getTime();
WScript.Echo(”Start time: ” + ts);
xmlHttp.send();
tr=new Date();
WScript.Echo(”End time: ” + tr.getTime());
WScript.Echo(”Server Time: ” + Date.parse( xmlHttp.getResponseHeader(’Date’)));
//Thu, 1 Jan 2009 09:47:01 GMT
tr.setTime(Date.parse( xmlHttp.getResponseHeader(’Date’)) + ((new Date()).getTime() - ts)/2);
//1230805540107
WScript.Echo(”debug time: ” + tr)
return tr;
//}
//catch(e)
//{
// return 0
//}
}
//set system time to dateString
//http://www.microsoft.com/technet/scriptcenter/topics/networking/08_atnc_advanced.mspx
//http://www.microsoft.com/technet/scriptcenter/guide/sas_wmi_fvwp.mspx?mfr=true
//20030327073509.519000+480
function setSystemDate(dateString)
{
var oSvc = GetObject(”winmgmts:\\\\.\\root\\cimv2″);
oSvc.Security_.Privileges.AddAsString(”SeSystemTimePrivilege”, 1);
var e = new Enumerator(oSvc.execQuery(”select * from win32_OperatingSystem”, “WQL”, 32));
for (;!e.atEnd();e.moveNext())e.item().SetDateTime(dateString);
}
//generating the right WMI DATETIME fields
with(getServerDate(”http://www.google.com/”)) //和哪一个HTTP服务器进行同步
{
setSystemDate(”" +
getUTCFullYear() +
(getUTCMonth()<9?”0″+(getUTCMonth()+1):(getUTCMonth()+1)) +
(getUTCDate()<9?”0″+getUTCDate():getUTCDate()) +
(getUTCHours()<9?”0″+getUTCHours():getUTCHours()) +
(getUTCMinutes()<9?”0″+getUTCMinutes():getUTCMinutes()) +
(getUTCSeconds()<9?”0″+getUTCSeconds():getUTCSeconds()) +
“.******+***”);
}
@echo off
echo regedit4>time.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time]>>time.reg
echo “Start”=dword:00000003>>time.reg
regedit/s time.reg
del time.reg
net stop w32time 2>nul
net time /SETSNTP:time.windows.com
net start w32time
est reply on 一月 2nd, 2008,8:24 下午:
李二嫂的猪 reply on 一月 2nd, 2008,12:34 下午:
Paveo reply on 一月 2nd, 2008,1:00 下午:
李二嫂的猪 reply on 一月 2nd, 2008,1:42 下午:
http://www.91files.com/?GBHDW9JXF7WUTC96CB5R
好东西…
不过还是希望自己不要碰见这个情况