找回密码
 加入
搜索
查看: 2385|回复: 8

怎样把一个txt文件内容显示出来。

  [复制链接]
发表于 2010-1-19 21:10:59 | 显示全部楼层 |阅读模式
比如一部小说。谢谢
发表于 2010-1-19 21:47:42 | 显示全部楼层
瞧这问题问得。。。
发表于 2010-1-19 21:52:06 | 显示全部楼层
$1=fileread (fileopen ("e:\1.txt","0"))
msgbox (0,"",$1)
fileclose ($1)
不知道这是不是你想要的?
发表于 2010-1-19 22:02:33 | 显示全部楼层
你这个问题,请参照    点此找相关的代码吧
发表于 2010-1-20 00:03:16 | 显示全部楼层
用一个textarea显示吧,messagebox不能超过1024字符的
发表于 2010-1-20 09:12:47 | 显示全部楼层
问题不明确  用什么显示 Msgbox还是调用系统的记事本?
发表于 2010-1-21 10:33:58 | 显示全部楼层
messagebox,肯定不能显示一部小说
 楼主| 发表于 2010-1-26 22:38:28 | 显示全部楼层
用什么都行。就是让人能看到。我以前是用记事本打开的。不好看。
发表于 2010-1-29 12:50:55 | 显示全部楼层
#include <file.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>

Opt('MustDeclareVars', 1)

Global $oMyError

Example()

Func Example()
    Local $myedit, $msg,$str

    GUICreate("我的编辑框窗口")  ; 创建居中窗口

    $myedit = GUICtrlCreateEdit("第一行" & @CRLF, 2, 2, 400, 400, $ES_readonly+$WS_VSCROLL)

    GUISetState()
        FileOpen("1.txt",0)
        $str=FileRead("1.txt")
        GUICtrlSetData($myedit,$str)
        FileClose("1.txt")

    While 1
        $msg = GUIGetMsg()
        
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete()
EndFunc   ;==>Example
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-22 13:30 , Processed in 0.071155 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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