关于Console.WriteLine的疑问
我现在按照一个例子做一个WindowForm,其中有端代码这么写:
try
{
....
}
catch(Exeception ex)
{
Console.WriteLine(ex.ToString());
}
我大致知道Console.WriteLine在控制台中是可以输出内容,但是这里的WindowForm系统这个函数有什么用,假设这段代码真出错了,代码移动到catch内部,ex.ToString()的内容是从哪儿输出东西啊?
刚开始学习WindowForm项目,不太明白,
谢谢!!
------解决方案--------------------winform中用Console.WriteLine(ex.ToString());
没有用呢
------解决方案--------------------the exception information will be displayed in a dos window, but I think it is for debugging purpose, normally, you should do
MessageBox.Show(ex.ToString());
of course, you proabably should catch specific exception and output friendly error messages to the user