请问实现textBox始终保持100行数据的方法。(数据超过100行就删除100行以后的数据。)private void addlog(string str)
{
string strTxtLog = textBoxLog.Text;
textBoxLog.Text = "[" + DateTime.Now.ToString() + "]" + str + "\r\n" + strTxtLog;
dellog();
}private void dellog()
{
//实现textBoxLog行数超过100行自动删除100行以后的数据。
}
{
string strTxtLog = textBoxLog.Text;
textBoxLog.Text = "[" + DateTime.Now.ToString() + "]" + str + "\r\n" + strTxtLog;
dellog();
}private void dellog()
{
//实现textBoxLog行数超过100行自动删除100行以后的数据。
}
解决方案 »
- C# .net中关于文件输出流 StreamWriter 的一个简单问题
- 有关C#的书籍
- 如何定义一个不包含字符的空定长string字符串变量
- c#中如何将串口接收到的数据给变量赋值
- 用vs自带的aboutbox做一个软件的“关于”对话框,求资料、求指导、求源码
- 寻求Byte[]数组的区块复制及比较的最高效方式
- 我创建了一个服务,但启动时却提示“错误1075:依赖服务不存在,或已被标记为删除”,错在那里?
- sql2005跨网访问服务器上的数据库
- 请问一个弹出窗口的问题,要求动态的显示一个图片,如何写?????谢谢
- 一个数据表之间的关联问题
- Web开发C#语言开发
- 高手来!HttpWebRequest模拟登录
{
removeat(100);
}
if (textBox1.Lines.Count() > limitLineCount)
{
this.textBox1.Text = string.Join("\r\n", this.textBox1.Lines.Take(limitLineCount));
}
if (count > 2)
{
string[] str = this.richTextBox1.Lines;
this.richTextBox1.Lines = new string[] { str[0], str[1] };
}楼上this.textBox1.Lines.Take(limitLineCount) Take 函数 是 4.0编译器的?