以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]读取文本文件时,写字本里是多行,读取到文本框后变成一行  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=185932)

--  作者:2425004926
--  发布时间:2023/3/26 13:21:00
--  [求助]读取文本文件时,写字本里是多行,读取到文本框后变成一行
 
 读取文本文件时,写字本里是多行,读取到文本框后变成一行?老师指点一下

If e.Node.Nodes.Count = 0 Then \'如果目录树节点无子节点

    Dim bm As String = e.Node.FullName \'节点路径

    Dim f As String = ProjectPath & "Attachments\\data\\E\\" & bm \'文件路径

    If FileSys.FileExists(f) Then \'文件存在时

        Dim ifo As New FileInfo(ProjectPath & "Attachments\\data\\E\\" & bm) \'文件信息类

        If ifo.Extension = ".js" OrElse ifo.Extension = ".json" OrElse ifo.Extension = ".wxml" OrElse ifo.Extension = ".js" Then

            Dim s As String = FileSys.ReadAllText(ProjectPath & "Attachments\\data\\E\\" & bm)

            e.Form.Controls("TextBox2").Text = s

        End If

    End If

End If
--  作者:2425004926
--  发布时间:2023/3/26 19:51:00
--  
已解决

s = s.Replace(vblf, vbcrlf) \'换行变为换行回车,换行(vblf)、回车(vbcr)、换行回车(vbcrlf)
e.Form.Controls("TextBox2").Text = s



--  作者:yuchunlnog
--  发布时间:2023/3/28 1:54:00
--  
感谢感谢。。