摘要
首先介绍了在Visual C#中的ToString()方法,然后主要介绍了它的两大应用:自定义格式化输出和数据录入容错处理。其中自定义格式化输出比较常用,可以输出我们需要的各种格式,在此只是简单的介绍总结;在容错处理中,指出了以往处理方法的一些弊端:画面混乱不稳定,不能给予正确清晰的错误提示;在此基础上提出了ToString()重写的方法,并通过实例说明了此方法的优越性:可以同时处理多种不同类型容错且错误提示清晰明了等。
Firstly introduces the method of ToString() in Visual C#,then presents two major applications of it:self-defined formatting the output and Fault-tolerant of data entry.The first one is commonly used,it can output a variety of formats that want,here only gives a brief summary of it.At the second,this paper points out some abuses of the previous approaches:the screen is chaos and instability,it can not give error prompts clearly and correctly;then on this basis puts forward override the method of ToString() and shows the superiority of this method by an example:it can deal with many different types of fault-tolerant at the same time and give error prompts clearly.
出处
《工业控制计算机》
2011年第7期52-53,55,共3页
Industrial Control Computer