怎样读取hosts文件内容
本帖最后由 sskjytkgg 于 2009-5-6 06:42 编辑怎样读取hosts文件内容,显示出文本框里面。。。 #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 多谢啦!!!!:face (30):
页:
[1]