用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())
...全文
456 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

3,423

社区成员

发帖
与我相关
我的任务
社区描述
其他开发语言 其他开发语言
社区管理员
  • 其他开发语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧