newsunman 发表于 2010-1-19 21:10:59

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

比如一部小说。谢谢

水木子 发表于 2010-1-19 21:47:42

瞧这问题问得。。。

59123608 发表于 2010-1-19 21:52:06

$1=fileread (fileopen ("e:\1.txt","0"))
msgbox (0,"",$1)
fileclose ($1)不知道这是不是你想要的?

lchl0588 发表于 2010-1-19 22:02:33

你这个问题,请参照    点此找相关的代码吧

yq314 发表于 2010-1-20 00:03:16

用一个textarea显示吧,messagebox不能超过1024字符的

haorui658 发表于 2010-1-20 09:12:47

问题不明确用什么显示 Msgbox还是调用系统的记事本?

ndyndy 发表于 2010-1-21 10:33:58

messagebox,肯定不能显示一部小说

newsunman 发表于 2010-1-26 22:38:28

用什么都行。就是让人能看到。我以前是用记事本打开的。不好看。

3mile 发表于 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
页: [1]
查看完整版本: 怎样把一个txt文件内容显示出来。