首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

关于Console.WriteLine的疑问,该怎么解决

2011-12-29 
关于Console.WriteLine的疑问我现在按照一个例子做一个WindowForm,其中有端代码这么写:try{....}catch(Exe

关于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

热点排行