允许文本框超过32K字符? [英] Allow textbox to go past 32K characters?

查看:83
本文介绍了允许文本框超过32K字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序正在使用多行文本框来记录相当长的过程的状态。 "更新与QUOT;通过调用textbox.AppendText进入

状态。


由于我的任务相当冗长,我远远超过了文本框的默认最大文本长度。根据文档,设置

MaxLength = 0会将此增加到基本上可用内存的限制。所以,在表单设计器中,我设置MaxLength属性

等于0.


然而,这没有任何区别,因为它仍然停止添加32K字符的文本。任何想法为什么它仍然会限制我?
限制我?或提供另一种提供状态的方法的建议?


-

Adam Clauss
ca ***** @ tamu.edu

解决方案

好吧,Text属性是串。 String'的Length属性是一个

整数 - 意味着长度不能超过32K(整数的最大值为b $ b)。所以看起来这是

String类的限制,虽然我不确定这是否明确提到了



" Adam Clauss" < CA ***** @ tamu.edu>在消息中写道

新闻:eM ************** @ TK2MSFTNGP11.phx.gbl ...

我有一个应用程序使用多行文本框记录相当长的过程的状态
。 "更新与QUOT;通过调用textbox.AppendText来确定状态。

因为我的任务相当冗长,所以我远远超过了文本框的默认最大文本长度
。根据文档,设置MaxLength = 0会将此增加到基本上可用
内存的限制。因此,在表单设计器中,我将MaxLength属性设置为0.

然而,这没有任何区别,因为它仍然停止以32K字符添加文本
。任何想法为什么它仍然会限制我?或者提供另一种提供
状态的方法的建议?
-
Adam Clauss
ca*****@tamu.edu



嗯...不,它根本就没有提到这一点。


来自MaxLength上的MSDN doc:

Windows NT 4.0,Windows 2000,Windows Server 2003家族平台注意:对于单行文本框控件,如果MaxLength

属性设置为0,用户可输入的最大字符数为2147483646或基于可用内存的金额,

以较小者为准。对于多行文本框控件,用户可以输入的最大字符数为4294967295或基于可用内存的

金额,以较小者为准。


Windows 95,Windows 98,Windows 98 Second Edition,Windows Millennium Edition平台注意:对于单行文本框控件,如果

MaxLength属性设置为0,则用户可以输入的最大字符数为32,766或基于可用内存的金额
内存,以较小者为准。对于多行文本框控件,用户可以输入的最大字符数为65,535或基于可用内存的

金额,以较小者为准。


根据对此,因为我正在运行Windows XP(虽然未提及,我认为它遵循Windows 2000/2003),并且带有一个

多行文本框,我应该得到高达40亿个字符(或内存) ,但我有512MB的RAM,我不会耗尽32K ......)。

-

Adam Clauss
ca ***** @ tamu.edu

" Marina" <所以***** @ nospam.com>在消息新闻中写道:OS ************** @ tk2msftngp13.phx.gbl ...

好吧,Text属性是一个String。 String'的Length属性是一个整数 - 意味着长度不能超过32K(整数的最大值)。所以看起来这是对String类的限制,虽然我不确定是否明确提到它。

Adam Clauss < CA ***** @ tamu.edu>在消息中写道
新闻:eM ************** @ TK2MSFTNGP11.phx.gbl ...

我有一个正在使用的应用程序一个多行文本框,用于记录相当长的过程的状态


。 "更新与QUOT;通过调用textbox.AppendText来实现

状态。

因为我的任务相当冗长,所以我远远超过默认的最大文本长度


文本框。根据文档,设置

MaxLength = 0会将此增加到基本上可用


内存的限制。所以,在表单设计器中,我设置MaxLength属性

等于0.

然而,这没有任何区别,因为它仍然停止添加文本

32K字符。任何想法为什么它仍然会

限制我?或提供关于提供


状态的替代方法的建议?


-
Adam Clauss
ca ***** @ tamu.edu




并等待......所以int与System.Int32相同 - 一个带符号的32位整数。它的最大值远不及32K。它:

-2,147,483,648到2,147,483,647(按MSDN引用 - 用手工计算2 ^ 31)。


所以它不可能是字符串长度限制我。


-

Adam Clauss
ca ***** @ tamu.edu

" Marina" <所以***** @ nospam.com>在消息新闻中写道:OS ************** @ tk2msftngp13.phx.gbl ...

好吧,Text属性是一个String。 String'的Length属性是一个整数 - 意味着长度不能超过32K(整数的最大值)。所以看起来这是对String类的限制,虽然我不确定是否明确提到它。

Adam Clauss < CA ***** @ tamu.edu>在消息中写道
新闻:eM ************** @ TK2MSFTNGP11.phx.gbl ...

我有一个正在使用的应用程序一个多行文本框,用于记录相当长的过程的状态


。 "更新与QUOT;通过调用textbox.AppendText来实现

状态。

因为我的任务相当冗长,所以我远远超过默认的最大文本长度


文本框。根据文档,设置

MaxLength = 0会将此增加到基本上可用


内存的限制。所以,在表单设计器中,我设置MaxLength属性

等于0.

然而,这没有任何区别,因为它仍然停止添加文本

32K字符。任何想法为什么它仍然会

限制我?或提供关于提供


状态的替代方法的建议?


-
Adam Clauss
ca ***** @ tamu.edu




I''ve an application which is using a multiline textbox to log the status of a fairly long procedure. "Updates" are made to the
status by calling textbox.AppendText.

As my task is fairly lengthy, I go well past the default max text length of the textbox. According to the documentation, setting
MaxLength = 0 will increase this to basically the limit of available memory. So, in the form designer, I set the MaxLength property
equal to 0.

However, this has not made any difference, as it still stops adding text at 32K characters. Any ideas why it would still be
limiting me? Or suggestions on an alternative method for providing the status?

--
Adam Clauss
ca*****@tamu.edu

解决方案

Well, the Text property is a String. A String''s Length property is an
Integer - meaning the Length can not be longer then roughly 32K (the maximum
value for an integer). So it would seem that this is a limitation of the
String class, though I am not sure whether or not this is explicitly
mentioned.

"Adam Clauss" <ca*****@tamu.edu> wrote in message
news:eM**************@TK2MSFTNGP11.phx.gbl...

I''ve an application which is using a multiline textbox to log the status of a fairly long procedure. "Updates" are made to the status by calling textbox.AppendText.

As my task is fairly lengthy, I go well past the default max text length of the textbox. According to the documentation, setting MaxLength = 0 will increase this to basically the limit of available memory. So, in the form designer, I set the MaxLength property equal to 0.

However, this has not made any difference, as it still stops adding text at 32K characters. Any ideas why it would still be limiting me? Or suggestions on an alternative method for providing the status?
--
Adam Clauss
ca*****@tamu.edu



Hmm... no, it does not mention this at all.

From MSDN doc on MaxLength:
Windows NT 4.0, Windows 2000, Windows Server 2003 family Platform Note: For single line text box controls, if the MaxLength
property is set to 0, the maximum number of characters the user can enter is 2147483646 or an amount based on available memory,
whichever is smaller. For multiline text box controls, the maximum number of characters the user can enter is 4294967295 or an
amount based on available memory, whichever is smaller.

Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition Platform Note: For single line text box controls, if
the MaxLength property is set to 0, the maximum number of characters the user can enter is 32,766 or an amount based on available
memory, whichever is smaller. For multiline text box controls, the maximum number of characters the user can enter is 65,535 or an
amount based on available memory, whichever is smaller.

According to this, since I''m running Windows XP (although not mentioned, I assume it follows with Windows 2000/2003) with a
multiline text box I should get up to 4 billion characters (or memory, but I have 512MB of RAM, I''m not running out at 32K...).
--
Adam Clauss
ca*****@tamu.edu
"Marina" <so*****@nospam.com> wrote in message news:OS**************@tk2msftngp13.phx.gbl...

Well, the Text property is a String. A String''s Length property is an
Integer - meaning the Length can not be longer then roughly 32K (the maximum
value for an integer). So it would seem that this is a limitation of the
String class, though I am not sure whether or not this is explicitly
mentioned.

"Adam Clauss" <ca*****@tamu.edu> wrote in message
news:eM**************@TK2MSFTNGP11.phx.gbl...

I''ve an application which is using a multiline textbox to log the status


of a fairly long procedure. "Updates" are made to the

status by calling textbox.AppendText.

As my task is fairly lengthy, I go well past the default max text length


of the textbox. According to the documentation, setting

MaxLength = 0 will increase this to basically the limit of available


memory. So, in the form designer, I set the MaxLength property

equal to 0.

However, this has not made any difference, as it still stops adding text


at 32K characters. Any ideas why it would still be

limiting me? Or suggestions on an alternative method for providing the


status?


--
Adam Clauss
ca*****@tamu.edu




And wait... so an int is same as System.Int32 - a signed 32 bit integer. Its max is nowhere near 32K. Its:
-2,147,483,648 to 2,147,483,647 (as quoted per MSDN - and done by hand calculation 2^31).

So it can''t be the string length limiting me.

--
Adam Clauss
ca*****@tamu.edu
"Marina" <so*****@nospam.com> wrote in message news:OS**************@tk2msftngp13.phx.gbl...

Well, the Text property is a String. A String''s Length property is an
Integer - meaning the Length can not be longer then roughly 32K (the maximum
value for an integer). So it would seem that this is a limitation of the
String class, though I am not sure whether or not this is explicitly
mentioned.

"Adam Clauss" <ca*****@tamu.edu> wrote in message
news:eM**************@TK2MSFTNGP11.phx.gbl...

I''ve an application which is using a multiline textbox to log the status


of a fairly long procedure. "Updates" are made to the

status by calling textbox.AppendText.

As my task is fairly lengthy, I go well past the default max text length


of the textbox. According to the documentation, setting

MaxLength = 0 will increase this to basically the limit of available


memory. So, in the form designer, I set the MaxLength property

equal to 0.

However, this has not made any difference, as it still stops adding text


at 32K characters. Any ideas why it would still be

limiting me? Or suggestions on an alternative method for providing the


status?


--
Adam Clauss
ca*****@tamu.edu




这篇关于允许文本框超过32K字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆