0
我是NSIS脚本安装程序的新手。我需要在自定义页面中创建一个带Multiline支持的TextBox。需要读取文本文件并将文本内容设置为TextBox。请在下面找到我的代码块:使用nsdialog将文本文件读入文本框? NSIS
StrCpy $3 ""
FileOpen $4 "C:\Users\Surya\Desktop\Installer\License.txt" r
loop:
FileRead $4 $1
StrCpy $3 "$3$1" ; append the line and copy it to another variable
IfErrors +1 loop
FileClose $4
${NSD_SetText} $ctrlTextBox "$3"
上面的代码能够只读只有8119字,但我的文件包含30,000个字符。
请帮我阅读大文件并将内容设置为TextBox。
谢谢
TextBox有一些限制 - 文本的长度。我建议使用Rich Edit Box。此外,NSIS变量的大小有限 - 我认为它是1024个字符。 – Slappy 2012-07-17 05:31:16
您有EM_LIMITTEXT来扩展文本框总数限制。 1024是ANSI版本的默认变量大小,但他可能使用不同的版本... – Anders 2012-07-17 06:06:02
感谢安德斯, 丰富的编辑控件解决了我的问题 ; === TextBox1(type:TextMultiline)=== nsDialogs :: CreateControl RichEdit20A $ {WS_VISIBLE} | $ {WS_CHILD} | $ {WS_TABSTOP} | $ {WS_VSCROLL} | $ {ES_READONLY} | $ {ES_MULTIline} | $ { ES_WANTRETURN} $ {__ NSD_Text_EXSTYLE} 8 120 440 104“” Pop $ txtLicenseControl nsRichEdit :: Load $ txtLicenseControl“C:\ Users \ Surya \ Desktop \ Installer \ License.txt” – 2012-08-02 08:39:57