|
kennyfan
中级用户
  
积分 259
发帖 112
注册 2006-9-18
状态 离线
|
『楼 主』:
[以结] 用bat把某网站的时间导入问题
使用 LLM 解释/回答一下
有没有办法写个BAT 将 http://www.time.ac.cn/stime.asp 网站的时间日期导入到电脑中
老兄们指点一下啊!想到我头都晕了!
Last edited by kennyfan on 2006-10-18 at 13:06 ]
Is there a way to write a BAT to import the time and date from the website http://www.time.ac.cn/stime.asp into the computer?
Brothers, give me some pointers! I'm getting dizzy thinking about it!
Last edited by kennyfan on 2006-10-18 at 13:06 ]
|
|
2006-10-18 05:50 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
vbs 我不会,我想的是wget 或者 vbs 下载网页源码,然后 for
VBS I don't know. I thought of using wget or VBS to download the web page source code, and then for
|
|
2006-10-18 06:05 |
|
|
kennyfan
中级用户
  
积分 259
发帖 112
注册 2006-9-18
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
问题是怎么下载? 只要能将时间部分变为文本就容易办.
The question is how to download? As long as the time part can be changed to text, it will be easy to handle.
|
|
2006-10-18 06:09 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
为何不把这个网站的时间和你的电脑的时间对准,再直接在批处理里用%date%\%time%调用呢?这岂不是更方便么?
Why not align the time of this website with the time of your computer, and then directly use %date%\%time% in the batch processing to call it? Wouldn't this be more convenient?
|
|
2006-10-18 06:16 |
|
|
ily2013
中级用户
  
积分 247
发帖 83
注册 2005-9-12
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
我用wget下载回来后,用type+find可以提取出时间,再用echo 时间|time,正式的bat还要想想!
After I downloaded it with wget, I can extract the time with type + find, and then use echo time | time. I still need to think about the formal bat!
|
|
2006-10-18 06:29 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
Originally posted by kennyfan at 2006-10-18 06:09:
问题是怎么下载? 只要能将时间部分变为文本就容易办.
wget "http://www.time.ac.cn/stime.asp" 在wget 所在目录找stime.asp就是了
Originally posted by kennyfan at 2006-10-10 06:09:
The question is how to download? As long as the time part can be changed into text, it will be easy to handle.
wget "http://www.time.ac.cn/stime.asp" Just find stime.asp in the directory where wget is located
|
|
2006-10-18 06:34 |
|
|
kennyfan
中级用户
  
积分 259
发帖 112
注册 2006-9-18
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
呵呵.会下载了...编辑虽然烦了点,应该还可以做到!苦
先谢谢以上几位老兄了!
Last edited by kennyfan on 2006-10-18 at 06:53 ]
Hehe. Will download... Editing is a bit tedious, but should still be manageable! Hard
First, thank you to the above几位 brothers!
Last edited by kennyfan on 2006-10-18 at 06:53 ]
|
|
2006-10-18 06:49 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
其实下载下来的时间还是不准确的,呵呵,和网速有关
Actually, the downloaded time is still inaccurate, hehe, it's related to the network speed
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-10-18 09:05 |
|
|
kennyfan
中级用户
  
积分 259
发帖 112
注册 2006-9-18
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
5555555楼上的别打击我啊..!搞掂代码了呵呵!
@echo off
wget "http://www.time.ac.cn/stime.asp"
for /f "tokens=4 delims=; " %%i in ('find /i "var hrs" stime.asp') do set hrs=%%i
for /f "tokens=4 delims=; " %%i in ('find /i "var min" stime.asp') do set min=%%i
for /f "tokens=4 delims=; " %%i in ('find /i "var sec" stime.asp') do set sec=%%i
time %hrs%:%min%:%sec%
pause
555555 Don't dampen my spirits upstairs..! Got the code done hehe!
@echo off
wget "http://www.time.ac.cn/stime.asp"
for /f "tokens=4 delims=; " %%i in ('find /i "var hrs" stime.asp') do set hrs=%%i
for /f "tokens=4 delims=; " %%i in ('find /i "var min" stime.asp') do set min=%%i
for /f "tokens=4 delims=; " %%i in ('find /i "var sec" stime.asp') do set sec=%%i
time %hrs%:%min%:%sec%
pause
|
|
2006-10-18 09:20 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
真搞不懂楼主为何这么搞....
难道就是知道一下"标准"的北京时间么?
Really don't understand why the original poster did this...
Is it just to know the "standard" Beijing time?
|
|
2006-10-18 09:44 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
w32tm.exe /?
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-10-18 09:49 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
electronixtar 兄又找到一个好命令哦`顶了```
electronixtar brother found another good command again `top```
|
|
2006-10-18 10:53 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
ntcmds.chm::/time_w32tm.htm
ntcmds.chm::/time_w32tm.htm
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-10-18 11:22 |
|
|
kennyfan
中级用户
  
积分 259
发帖 112
注册 2006-9-18
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
没办法啊.电脑没电子了.用 w32tm.exe /resync 命令虽然可以达到时间同步 但要开启WINDOWS TIME服务的 这样比较耗内存啊! 而且速度比较慢!
There's no way. The computer has no power. Although the command w32tm.exe /resync can achieve time synchronization, it requires starting the WINDOWS TIME service. This consumes relatively more memory and is relatively slow!
|
|
2006-10-18 12:59 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
@echo off
<"%~f0" more +5 >tmp.vbs
cscript //NoLogo /e:vbscript tmp.vbs
del tmp.vbs
goto:eof
On Error Resume Next
Set oDOM = WScript.GetObject("http://www.time.ac.cn/stime.asp")
WScript.Sleep 5000
wscript.Echo oDOM.getElementById("clock").innerText
wsript.sleep 5000 是休息 5 秒(5000毫秒),等网页完全载入。可以根据你的网速适当修改
Last edited by electronixtar on 2006-10-18 at 22:37 ]
@echo off
<"%~f0" more +5 >tmp.vbs
cscript //NoLogo /e:vbscript tmp.vbs
del tmp.vbs
goto:eof
On Error Resume Next
Set oDOM = WScript.GetObject("http://www.time.ac.cn/stime.asp")
WScript.Sleep 5000
wscript.Echo oDOM.getElementById("clock").innerText
wsript.sleep 5000 is to wait for 5 seconds (5000 milliseconds) to let the web page fully load. You can adjust it appropriately according to your internet speed
Last edited by electronixtar on 2006-10-18 at 22:37 ]
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-10-18 22:33 |
|