找回密码
 加入
搜索
查看: 1288|回复: 2

为什么程序分开能运行?合并运行异常?

[复制链接]
发表于 2009-8-1 13:11:12 | 显示全部楼层 |阅读模式
本帖最后由 wuluck 于 2009-8-1 13:30 编辑

#include <IE.au3>
$oIE = _IECreate ("http://www.timedate.cn/worldclock/ti.asp")
$sText = _IEBodyReadText ($oIE)
$file = FileOpen("nod32id.txt", 2)
FileWrite($file, $sText)
$file1 = FileOpen("nod32id.txt", 0)
$chars = FileRead($file1,4)
    MsgBox(0, "读取的字符:", $chars)


获取网络的年份...
#include <IE.au3>
$oIE = _IECreate ("http://www.timedate.cn/worldclock/ti.asp")
$sText = _IEBodyReadText ($oIE)
$file = FileOpen("nod32id.txt", 2)
FileWrite($file, $sText)



$file1 = FileOpen("nod32id.txt", 0)
$chars = FileRead($file1,4)
    MsgBox(0, "读取的字符:", $chars)
分开运行正常.合并之后出不来时间
发表于 2009-8-1 14:51:58 | 显示全部楼层
因为你没有 FileClose($file)
发表于 2009-8-1 14:55:40 | 显示全部楼层
要获得同样的结果可以简单点:
#include <IE.au3>
$oIE = _IECreate ("http://www.timedate.cn/worldclock/ti.asp")
$sText = _IEBodyReadText ($oIE)
MsgBox(0, "读取的字符:", StringLeft($sText, 4))
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-22 23:38 , Processed in 0.080858 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表