我如何按行跟踪, [英] How Do I Make In The Line By Line Like Follows,

查看:59
本文介绍了我如何按行跟踪,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

广告系列不应为以下行中的空白

1 5 6 7

报告中的日期应等于以下行中在Portal中选择的报告日期

1 5 6 7

代理商ID不应为以下行中的空白

1 5 6 7



我的问题是,

我正在使用stringbuilder来分配所有错误消息。 stringbuilder字符串被分配给标签控件。如何显示上面的错误消息(逐行)?

Campaign should not be blank in the following lines
1 5 6 7
Date in the report should be equal to Report Date selected in Portal in the following lines
1 5 6 7
Agent Id should not be blank in the following lines
1 5 6 7

My question is,
I am using stringbuilder to assign all the error messages. And stringbuilder string is assigned to label control. How i make to display the error messages like above(line by line)?

推荐答案

在每一行之间插入一个回车换行符(CRLF)。



最安全的方法是使用< a href =https://msdn.microsoft.com/en-us/library/ system.environment.newline(v = vs.110).aspx> Environment.NewLine< / a> [< a href =https://msdn.microsoft.com/en-us/library/system.environment .newline(v = vs.110).aspxtarget =_ blanktitle =New Window> ^< / a>] eg

Insert a Carriage-Return-Linefeed (CRLF) between each line.

The safest way to do that is to use <a href="https://msdn.microsoft.com/en-us/library/system.environment.newline(v=vs.110).aspx">Environment.NewLine</a>[<a href="https://msdn.microsoft.com/en-us/library/system.environment.newline(v=vs.110).aspx" target="_blank" title="New Window">^</a>] e.g.
var sb = new StringBuilder();
sb.Append("Campaign should not be blank in the following lines");
sb.Append(Environment.NewLine);
sb.Append("1 5 6 7" );
sb.Append(Environment.NewLine);
sb.Append("Date in the report should be equal to Report Date selected in Portal in the following lines");
sb.Append(Environment.NewLine);
sb.Append("1 5 6 7");
sb.Append(Environment.NewLine);
sb.Append("Agent Id should not be blank in the following lines");
sb.Append(Environment.NewLine);
sb.Append("1 5 6 7");
label1.Text = sb.ToString();


strErrorMessage.AppendLine(\ n);

strErrorMessage.AppendLine(广告系列在以下行中不应为空:);

strErrorMessage.Append(1 2 3);



我这样解决了。

感谢所有.....
strErrorMessage.AppendLine("\n");
strErrorMessage.AppendLine("Campaign should not be blank in the following lines: ");
strErrorMessage.Append("1 2 3");

I solved in this way.
Thanks to all.....


这篇关于我如何按行跟踪,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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