用SetLocalTime修改时间不成功,拒绝访问,什么原因
aqtd2 2012-05-24 09:02:58 用aauto调用setlocaltime修改时间时出错,错误信息:拒绝访问。系统XP3,管理员身份
import console
import win.ui;
import inet.http
inet.clearCookie("time.ac.cn")
var html = inet.http().get("http://www.time.ac.cn/stime.asp")
var s1 = string.match(html,".+\(\'(.+)日\'\)\;");
var s2 = string.match(html,"var hrs = (.\d)\;");
var s3 = string.match(html,"var min = (.\d)\;");
var s4 = string.match(html,"var sec = (.\d)\;");
console.log("这是获取的网络时间",s1,s2,s3,s4)
var tm = time.now()
//取年月日
tm.year,tm.month,tm.day = string.match(html,"(\d+)年(\d+)月(\d+)日");
//取小时
//console.log(tm.hour)
tm.hour = s2
//console.log(tm.hour)
//取分
tm.minute = s3
//取秒
tm.second = s4
//设置时间API
console.log(tm)
SetLocalTime = ::Kernel32.api("SetLocalTime","int(struct& lpSystemTime)")
//修改系统时间
SetLocalTime(tm)
io.open()
io.print( ..lasterr())