找回密码
 加入
搜索
查看: 3102|回复: 7

[AU3基础] (已解决)au3能监控写入.txt文件的数据吗?

  [复制链接]
发表于 2011-3-25 23:57:04 | 显示全部楼层 |阅读模式
本帖最后由 lhy6456210 于 2011-3-27 23:08 编辑

问一个问题,能不能监控指定的.txt文件,如果有数据写入.txt文件,把写入的数据截取出来,返回到指定的au3的gui上;



最好是能用AU3搞定的方法:
发表于 2011-3-26 00:28:41 | 显示全部楼层
 楼主| 发表于 2011-3-26 11:59:45 | 显示全部楼层
小A啊!世界真小啊!
发表于 2011-3-27 11:52:49 | 显示全部楼层
正好了!正需要
发表于 2011-3-27 11:58:11 | 显示全部楼层
Global $Edit1,$filepath = @ScriptDir & '\wglm.txt' , $fileDetection = ''
GUICreate("txt文件监控", 426, 323, 192, 114)
$Edit1 = GUICtrlCreateEdit("", 0, 0, 425, 321)
GUISetState(@SW_SHOW)
If Not FileExists($filepath) Then FileWrite($filepath ,'bbs.wglm.net');如果wglm.txt文件不存在时,自动创建.
While 1
$file = FileRead($filepath);读取wglm.txt文本
If $file <> $fileDetection Then;当文件发生变化时;写入到Edit控件
  $fileDetection = $file;将读取的数据赋值给$fileDetection
  GUICtrlSetData($Edit1, $file);写入wglm.txt文本到Edit1控件
EndIf
Sleep(600)
WEnd
发表于 2011-3-27 20:29:04 | 显示全部楼层
要完全与题相符,有点难度
发表于 2011-6-25 18:46:19 | 显示全部楼层
学习!!!!!!
发表于 2012-12-28 17:20:15 | 显示全部楼层
呵呵!!!!!!!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-29 05:23 , Processed in 0.079623 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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