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

怎样读取hosts文件内容

[复制链接]
发表于 2009-4-28 11:16:39 | 显示全部楼层 |阅读模式
本帖最后由 sskjytkgg 于 2009-5-6 06:42 编辑

怎样读取hosts文件内容,显示出文本框里面。。。
发表于 2009-4-28 13:30:06 | 显示全部楼层
#include <GUIConstantsEx.au3>                
$width = 400
$hight = 400
$MainGUI = GUICreate("Hosts", $width, $hight, @DesktopWidth / 2 - $width / 2, @DesktopHeight / 2 - $hight / 2, -1)
$Edit1 = GUICtrlCreateEdit("", -1, -1, 400, 400)
$fo = FileOpen ( @SystemDir&"\Drivers\Etc\Hosts",0)
$fr = FileRead ($fo )
GUICtrlSetData($Edit1, $fr)
;MsgBox(0, "Hosts",$fr)
GUISetState(@SW_SHOW)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Exit
        EndSwitch
WEnd        
 楼主| 发表于 2009-4-29 09:08:05 | 显示全部楼层
多谢啦!!!!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-28 16:44 , Processed in 0.082627 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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